Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOBILE-4532 quiz: Update behat tests #3955

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
NoelDeMartin marked this conversation as resolved.
Show resolved Hide resolved
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.
Loading