Skip to content

Commit

Permalink
MOBILE-4532 quiz: Update behat tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
marxjohnson committed Mar 7, 2024
1 parent 0c49a45 commit 11314ff
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
24 changes: 20 additions & 4 deletions src/addons/mod/quiz/tests/behat/basic_usage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ Feature: Attempt a quiz in app

When I press "Submit all and finish" in the app
And I press "Submit" near "Once you submit" in the app
Then I should find "Review" in the app
And I should find "Started on" in the app
And I run all adhoc tasks
And I pull to refresh until I find "Review" in the app
Then I should find "Started on" in the app
And I should find "State" in the app
And I should find "Completed on" in the app
And I should find "Time taken" in the app
Expand Down Expand Up @@ -182,8 +183,9 @@ Feature: Attempt a quiz in app
Then I should find "Questions without a response: 1" in the app

When I press "Submit" in the app
Then I should find "Review" in the app
And I should find "Finished" in the app
And I run all adhoc tasks
And I pull to refresh until I find "Review" in the app
Then I should find "Finished" in the app
And I should find "Not yet graded" in the app

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

When I press "Submit" in the app
Then I should find "Review" in the app
And I should find "Finished" within "State" "ion-item" in the app
And I should find "Not yet graded" within "Grade" "ion-item" in the app

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]"
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]"
Expand All @@ -218,5 +222,17 @@ Feature: Attempt a quiz in app
And I log in as "teacher1"
And I follow "Attempts: 1"
And I follow "Review attempt"
Then I should see "Submitted"
But I should not see "1.00/2.00"
When I run all adhoc tasks
And I reload the page
Then I should see "Finished"
And I should see "1.00/2.00"
When I switch back to the app
And I entered the quiz activity "Quiz 1" on course "Course 1" as "student1" in the app
And I pull to refresh until I find "Highest grade: 50 / 100" in the app
Then I should not find "Not yet graded" in the app
When I press "1" within "Finished" "ion-item" in the app
Then I should find "Finished" within "State" "ion-item" in the app
And I should find "1" within "Marks / 2" "ion-item" in the app
And I should find "50" within "Grade / 100" "ion-item" in the app
5 changes: 3 additions & 2 deletions src/addons/mod/quiz/tests/behat/quiz_behaviour.feature
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ Feature: Use quizzes with different behaviours in the app
And I press "Submit" in the app
And I press "Submit all and finish" in the app
And I press "Submit" near "Once you submit" in the app
Then I should find "CBM mark 1.50" in the app
And I should find "Parts, but only parts, of your response are correct" in the app
And I run all adhoc tasks
And I pull to refresh until I find "CBM mark 1.50" in the app
Then I should find "Parts, but only parts, of your response are correct" in the app

Scenario: Interactive behaviour
Given the following "activities" exist:
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 11314ff

Please sign in to comment.