Skip to content

Commit 50cf8e0

Browse files
committed
MOBILE-4345 quiz: Test sequential navigation
1 parent 4a10f1a commit 50cf8e0

File tree

1 file changed

+71
-3
lines changed

1 file changed

+71
-3
lines changed

src/addons/mod/quiz/tests/behat/quiz_navigation.feature

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,39 @@ Feature: Attempt a quiz in app
1515
| user | course | role |
1616
| student1 | C1 | student |
1717
And the following "activities" exist:
18-
| activity | name | intro | course | idnumber |
19-
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 |
18+
| activity | name | intro | course | idnumber | navmethod |
19+
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | free |
20+
| quiz | Quiz 2 | Quiz 2 description | C1 | quiz2 | sequential |
2021
And the following "question categories" exist:
2122
| contextlevel | reference | name |
2223
| Course | C1 | Test questions |
2324
And the following "questions" exist:
2425
| questioncategory | qtype | name | questiontext |
2526
| Test questions | truefalse | TF1 | Text of the first question |
2627
| Test questions | truefalse | TF2 | Text of the second question |
28+
| Test questions | truefalse | TF3 | Text of the third question |
2729
And quiz "Quiz 1" contains the following questions:
2830
| question | page |
2931
| TF1 | 1 |
3032
| TF2 | 2 |
33+
And quiz "Quiz 2" contains the following questions:
34+
| question | page |
35+
| TF1 | 1 |
36+
| TF2 | 2 |
37+
| TF3 | 3 |
3138

3239
Scenario: Next and previous navigation
3340
Given I entered the quiz activity "Quiz 1" on course "Course 1" as "student1" in the app
3441
And I press "Attempt quiz now" in the app
3542
Then I should find "Text of the first question" in the app
3643
But I should not find "Text of the second question" in the app
3744

38-
When I press "Next" in the app
45+
When I press "Open navigation popover" in the app
46+
Then I should find "Question 1" in the app
47+
And I should find "Question 2" in the app
48+
49+
When I press "Close" in the app
50+
And I press "Next" in the app
3951
Then I should find "Text of the second question" in the app
4052
But I should not find "Text of the first question" in the app
4153

@@ -54,6 +66,8 @@ Feature: Attempt a quiz in app
5466
When I press "Next" in the app
5567
And I press "Submit" in the app
5668
Then I should find "Summary of attempt" in the app
69+
And I should find "Not yet answered" within "1" "ion-item" in the app
70+
And I should find "Not yet answered" within "2" "ion-item" in the app
5771

5872
When I press "Not yet answered" within "2" "ion-item" in the app
5973
Then I should find "Text of the second question" in the app
@@ -69,3 +83,57 @@ Feature: Attempt a quiz in app
6983
When I press "Submit all and finish" in the app
7084
And I press "OK" near "Once you submit" in the app
7185
Then I should find "Review" in the app
86+
And I should find "Text of the first question" in the app
87+
And I should find "Text of the second question" in the app
88+
89+
Scenario: Sequential navigation
90+
Given I entered the quiz activity "Quiz 2" on course "Course 1" as "student1" in the app
91+
And I press "Attempt quiz now" in the app
92+
Then I should find "Text of the first question" in the app
93+
But I should not find "Text of the second question" in the app
94+
And I should not find "Text of the third question" in the app
95+
96+
When I press "Open navigation popover" in the app
97+
Then I should find "Question 1" in the app
98+
But I should not find "Question 2" in the app
99+
And I should not find "Question 3" in the app
100+
101+
When I press "Close" in the app
102+
And I press "Next" in the app
103+
Then I should find "Text of the second question" in the app
104+
But I should not find "Text of the first question" in the app
105+
And I should not find "Text of the third question" in the app
106+
And I should not find "Previous" in the app
107+
108+
When I press "Open navigation popover" in the app
109+
Then I should find "Question 2" in the app
110+
But I should not find "Question 1" in the app
111+
And I should not find "Question 3" in the app
112+
113+
When I press "Close" in the app
114+
And I press "Next" in the app
115+
Then I should find "Text of the third question" in the app
116+
But I should not find "Text of the first question" in the app
117+
And I should not find "Text of the second question" in the app
118+
And I should not find "Previous" in the app
119+
120+
When I press "Open navigation popover" in the app
121+
Then I should find "Question 3" in the app
122+
But I should not find "Question 1" in the app
123+
And I should not find "Question 2" in the app
124+
125+
When I press "Close" in the app
126+
And I press "Submit" in the app
127+
Then I should find "Summary of attempt" in the app
128+
# @todo MOBILE-4350: Uncomment these.
129+
# And I should find "Not yet answered" within "1" "ion-item" in the app
130+
# And I should find "Not yet answered" within "2" "ion-item" in the app
131+
# And I should find "Not yet answered" within "3" "ion-item" in the app
132+
133+
When I press "Submit all and finish" in the app
134+
And I press "OK" near "Once you submit" in the app
135+
Then I should find "Review" in the app
136+
# @todo MOBILE-4350: Uncomment these.
137+
# And I should find "Text of the first question" in the app
138+
# And I should find "Text of the second question" in the app
139+
# And I should find "Text of the third question" in the app

0 commit comments

Comments
 (0)