Skip to content

Commit 11314ff

Browse files
committed
MOBILE-4532 quiz: Update behat tests
MDL-68806 adds the new "Submitted" quiz attempt state, which means that once an attempt is submitted, grades will not be available until the ad-hoc tasks have run.
1 parent 0c49a45 commit 11314ff

4 files changed

+23
-6
lines changed

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

+20-4
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ Feature: Attempt a quiz in app
124124

125125
When I press "Submit all and finish" in the app
126126
And I press "Submit" near "Once you submit" in the app
127-
Then I should find "Review" in the app
128-
And I should find "Started on" in the app
127+
And I run all adhoc tasks
128+
And I pull to refresh until I find "Review" in the app
129+
Then I should find "Started on" in the app
129130
And I should find "State" in the app
130131
And I should find "Completed on" in the app
131132
And I should find "Time taken" in the app
@@ -182,8 +183,9 @@ Feature: Attempt a quiz in app
182183
Then I should find "Questions without a response: 1" in the app
183184

184185
When I press "Submit" in the app
185-
Then I should find "Review" in the app
186-
And I should find "Finished" in the app
186+
And I run all adhoc tasks
187+
And I pull to refresh until I find "Review" in the app
188+
Then I should find "Finished" in the app
187189
And I should find "Not yet graded" in the app
188190

189191
When I press "Correct" within "Question 2" "ion-card" in the app
@@ -206,6 +208,8 @@ Feature: Attempt a quiz in app
206208

207209
When I press "Submit" in the app
208210
Then I should find "Review" in the app
211+
And I should find "Finished" within "State" "ion-item" in the app
212+
And I should find "Not yet graded" within "Grade" "ion-item" in the app
209213

210214
When I replace "/.*/" within "page-addon-mod-quiz-review core-loading > ion-card ion-item:nth-child(1) p:nth-child(2)" with "[Started on date]"
211215
And I replace "/.*/" within "page-addon-mod-quiz-review core-loading > ion-card ion-item:nth-child(3) p:nth-child(2)" with "[Completed on date]"
@@ -218,5 +222,17 @@ Feature: Attempt a quiz in app
218222
And I log in as "teacher1"
219223
And I follow "Attempts: 1"
220224
And I follow "Review attempt"
225+
Then I should see "Submitted"
226+
But I should not see "1.00/2.00"
227+
When I run all adhoc tasks
228+
And I reload the page
221229
Then I should see "Finished"
222230
And I should see "1.00/2.00"
231+
When I switch back to the app
232+
And I entered the quiz activity "Quiz 1" on course "Course 1" as "student1" in the app
233+
And I pull to refresh until I find "Highest grade: 50 / 100" in the app
234+
Then I should not find "Not yet graded" in the app
235+
When I press "1" within "Finished" "ion-item" in the app
236+
Then I should find "Finished" within "State" "ion-item" in the app
237+
And I should find "1" within "Marks / 2" "ion-item" in the app
238+
And I should find "50" within "Grade / 100" "ion-item" in the app

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ Feature: Use quizzes with different behaviours in the app
104104
And I press "Submit" in the app
105105
And I press "Submit all and finish" in the app
106106
And I press "Submit" near "Once you submit" in the app
107-
Then I should find "CBM mark 1.50" in the app
108-
And I should find "Parts, but only parts, of your response are correct" in the app
107+
And I run all adhoc tasks
108+
And I pull to refresh until I find "CBM mark 1.50" in the app
109+
Then I should find "Parts, but only parts, of your response are correct" in the app
109110

110111
Scenario: Interactive behaviour
111112
Given the following "activities" exist:

0 commit comments

Comments
 (0)