From bb269382be80814e72fcbc0bdd16aa3d8707ddeb Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Thu, 10 Mar 2022 11:19:27 +0100 Subject: [PATCH] MOBILE-3833 behat: Update quiz steps --- mod/quiz/tests/behat/app_basic_usage.feature | 26 ++++---- .../tests/behat/app_quiz_navigation.feature | 59 +++++++++++-------- 2 files changed, 47 insertions(+), 38 deletions(-) diff --git a/mod/quiz/tests/behat/app_basic_usage.feature b/mod/quiz/tests/behat/app_basic_usage.feature index f9f654800..4a5e94ba5 100755 --- a/mod/quiz/tests/behat/app_basic_usage.feature +++ b/mod/quiz/tests/behat/app_basic_usage.feature @@ -79,14 +79,14 @@ Feature: Attempt a quiz in app But I should not find "Text of the second question" in the app When I press "Next" near "Question 1" in the app - And I press "Next" near "Quiz 1" in the app + And I press "Submit" near "Quiz 1" in the app Then I should find "Summary of attempt" in the app - When I press "Return to attempt" in the app + When I press "Not yet answered" within "2" "ion-item" in the app Then I should find "Text of the second question" in the app But I should not find "Text of the first question" in the app - When I press "Next" in the app + When I press "Submit" in the app And I press "Submit all and finish" in the app Then I should find "Once you submit" in the app @@ -95,7 +95,7 @@ Feature: Attempt a quiz in app When I press "Submit all and finish" in the app And I press "OK" near "Once you submit" in the app - Then I should find "Review of attempt 1" in the app + Then I should find "Review" in the app And 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 @@ -111,11 +111,11 @@ Feature: Attempt a quiz in app And I press "Attempt quiz now" in the app And I press "Four" in the app And I press "Three" in the app - And I press "Next" "ion-button" near "Quiz 2" in the app + And I press "Next" near "Quiz 2" in the app And I set the field "Answer" to "testing" in the app - And I press "Next" "ion-button" near "Question 2" in the app + And I press "Next" near "Question 2" in the app And I set the field "Answer" to "5" in the app - And I press "Next" "ion-button" near "Question 3" in the app + And I press "Next" near "Question 3" in the app And I set the field "Answer" to "Testing an essay" in the app And I press "Next" "ion-button" near "Question 4" in the app And I press "quick" ".drag" in the app @@ -124,21 +124,21 @@ Feature: Attempt a quiz in app And I press "" ".place2.drop" in the app And I press "lazy" ".drag" in the app And I press "" ".place3.drop" in the app - And I press "Next" "ion-button" near "Question 5" in the app + And I press "Next" near "Question 5" in the app And I press "True" in the app - And I press "Next" "ion-button" near "Question 6" in the app + And I press "Next" near "Question 6" in the app And I press "Choose... , frog" in the app And I press "amphibian" in the app And I press "Choose... , newt" in the app And I press "insect" in the app And I press "Choose... , cat" in the app And I press "mammal" in the app - And I press "Next" "ion-button" near "Question 7" in the app + And I press "Submit" near "Question 7" in the app Then I should not find "Not yet answered" in the app When I press "Submit all and finish" in the app And I press "OK" in the app - Then I should find "Review of attempt 1" in the app + Then I should find "Review" in the app And I should find "Finished" in the app And I should find "Not yet graded" in the app @@ -149,10 +149,10 @@ Feature: Attempt a quiz in app And I press "True" in the app And I press "Next" near "Question 1" in the app And I press "False" in the app - And I press "Next" near "Question 2" in the app + And I press "Submit" near "Question 2" in the app And I press "Submit all and finish" in the app And I press "OK" in the app - Then I should find "Review of attempt 1" in the app + Then I should find "Review" in the app When I enter the course "Course 1" as "teacher1" in the app And I press "Quiz 1" in the app diff --git a/mod/quiz/tests/behat/app_quiz_navigation.feature b/mod/quiz/tests/behat/app_quiz_navigation.feature index 6cd114a3b..cf52af5c2 100644 --- a/mod/quiz/tests/behat/app_quiz_navigation.feature +++ b/mod/quiz/tests/behat/app_quiz_navigation.feature @@ -36,30 +36,39 @@ Feature: Attempt a quiz in app And I press "Quiz 1" in the app And I press "Attempt quiz now" in the app Then I should find "Text of the first question" in the app - And I should not find "Text of the second question" in the app - And I press "Next" near "Question 1" in the app - And I should find "Text of the second question" in the app - And I should not find "Text of the first question" in the app - And I press "Previous" near "Question 2" in the app - And I should not find "Text of the second question" in the app - And I should find "Text of the first question" in the app - And I press "Next" near "Quiz 1" in the app - And I should find "Text of the second question" in the app - And I should not find "Text of the first question" in the app - And I press "Previous" near "Quiz 1" in the app - And I should not find "Text of the second question" in the app - And I should find "Text of the first question" in the app - And I press "Next" near "Question 1" in the app - And I press "Next" near "Quiz 1" in the app - And I should find "Summary of attempt" in the app - And I press "Return to attempt" in the app - And I should find "Text of the second question" in the app - And I should not find "Text of the first question" in the app - And I press "Next" in the app - And I press "Submit all and finish" in the app - And I should find "Once you submit" in the app - And I press "Cancel" near "Once you submit" in the app - And I should find "Summary of attempt" in the app + But I should not find "Text of the second question" in the app + + When I press "Next" near "Question 1" in the app + Then I should find "Text of the second question" in the app + But I should not find "Text of the first question" in the app + + When I press "Previous" near "Question 2" in the app + Then I should find "Text of the first question" in the app + But I should not find "Text of the second question" in the app + + When I press "Next" near "Quiz 1" in the app + Then I should find "Text of the second question" in the app + But I should not find "Text of the first question" in the app + + When I press "Previous" near "Quiz 1" in the app + Then I should find "Text of the first question" in the app + But I should not find "Text of the second question" in the app + + When I press "Next" near "Question 1" in the app + And I press "Submit" in the app + Then I should find "Summary of attempt" in the app + + When I press "Not yet answered" within "2" "ion-item" in the app + Then I should find "Text of the second question" in the app + But I should not find "Text of the first question" in the app + + When I press "Submit" in the app And I press "Submit all and finish" in the app + Then I should find "Once you submit" in the app + + When I press "Cancel" near "Once you submit" in the app + Then I should find "Summary of attempt" in the app + + When I press "Submit all and finish" in the app And I press "OK" near "Once you submit" in the app - And I should find "Review" in the app + Then I should find "Review" in the app