From 370a14c1bc1735f08d6ec3d6855c9f0b48ef93a1 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 18 Apr 2023 09:45:25 +0200 Subject: [PATCH 1/3] MOBILE-4270 quiz: Fix 3.9 tests --- .../quiz/tests/behat/basic_usage-39.feature | 118 ++++++++++++++++++ .../mod/quiz/tests/behat/basic_usage.feature | 1 + 2 files changed, 119 insertions(+) create mode 100644 src/addons/mod/quiz/tests/behat/basic_usage-39.feature diff --git a/src/addons/mod/quiz/tests/behat/basic_usage-39.feature b/src/addons/mod/quiz/tests/behat/basic_usage-39.feature new file mode 100644 index 000000000..89f805963 --- /dev/null +++ b/src/addons/mod/quiz/tests/behat/basic_usage-39.feature @@ -0,0 +1,118 @@ +@mod @mod_quiz @app @javascript @lms_upto3.9 +Feature: Attempt a quiz in app + As a student + In order to demonstrate what I know + I need to be able to attempt quizzes + + Background: + Given the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "users" exist: + | username | + | student1 | + | teacher1 | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | + And the following "question categories" exist: + | contextlevel | reference | name | + | Course | C1 | Test questions | + And the following "questions" exist: + | questioncategory | qtype | name | questiontext | + | Test questions | truefalse | TF1 | Text of the first question | + | Test questions | truefalse | TF2 | Text of the second question | + And quiz "Quiz 1" contains the following questions: + | question | page | + | TF1 | 1 | + | TF2 | 2 | + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | quiz | Quiz 2 | Quiz 2 description | C1 | quiz2 | + And the following "question categories" exist: + | contextlevel | reference | name | + | Course | C1 | Test questions 2 | + And the following "questions" exist: + | questioncategory | qtype | name | questiontext | + | Test questions | multichoice | TF3 | Text of the first question | + | Test questions | shortanswer | TF4 | Text of the second question | + | Test questions | numerical | TF5 | Text of the third question | + | Test questions | essay | TF6 | Text of the fourth question | + | Test questions | ddwtos | TF7 | The [[1]] brown [[2]] jumped over the [[3]] dog. | + | Test questions | truefalse | TF8 | Text of the sixth question | + | Test questions | match | TF9 | Text of the seventh question | + | Test questions | description | TF10 | Text of the eighth question | + And the following "questions" exist: + | questioncategory | qtype | name | template | + | Test questions | gapselect | TF11 | missingchoiceno | + | Test questions | ddimageortext | TF12 | xsection | + | Test questions | ddmarker | TF13 | mkmap | + And quiz "Quiz 2" contains the following questions: + | question | page | + | TF3 | 1 | + | TF4 | 2 | + | TF5 | 3 | + | TF6 | 4 | + | TF7 | 5 | + | TF8 | 6 | + | TF9 | 7 | + | TF10 | 8 | + | TF11 | 9 | + | TF12 | 10 | + | TF13 | 11 | + + # This scenario is duplicated from main because the description type question (the eighth) + # cannot be filled in 3.9, since the selects are missing accessible labels. + Scenario: Attempt a quiz (all question types) + Given I entered the quiz activity "Quiz 2" on course "Course 1" as "student1" in the app + When 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" in the app + And I set the field "Answer" to "testing" in the app + And I press "Next" in the app + And I set the field "Answer" to "5" in the app + And I press "Next" in the app + And I set the field "Answer" to "Testing an essay" in the app + And I press "Next" "ion-button" in the app + And I press "quick" ".drag" in the app + And I click on ".place1.drop" "css" + And I press "fox" ".drag" in the app + And I click on ".place2.drop" "css" + And I press "lazy" ".drag" in the app + And I click on ".place3.drop" "css" + And I press "Next" in the app + And I press "True" in the app + And I press "Next" 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" in the app + Then I should find "Text of the eighth question" in the app + + When I press "Next" in the app + And I press "Next" in the app + And I press "abyssal" ".drag" in the app + And I click on ".place6.dropzone" "css" + And I press "trench" ".drag" in the app + And I click on ".place3.dropzone" "css" + And I press "Next" in the app + And I press "Railway station" ".marker" in the app + And I click on "img.dropbackground" "css" + And I press "Submit" in the app + Then I should find "Answer saved" in the app + And I should find "Not yet answered" within "8" "ion-item" in the app + And I should find "Incomplete answer" within "9" "ion-item" 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" in the app + And I should find "Finished" in the app + And I should find "Not yet graded" in the app diff --git a/src/addons/mod/quiz/tests/behat/basic_usage.feature b/src/addons/mod/quiz/tests/behat/basic_usage.feature index cdd2e4249..c0f724d31 100755 --- a/src/addons/mod/quiz/tests/behat/basic_usage.feature +++ b/src/addons/mod/quiz/tests/behat/basic_usage.feature @@ -119,6 +119,7 @@ Feature: Attempt a quiz in app And I should find "Question 1" in the app And I should find "Question 2" in the app + @lms_from3.10 Scenario: Attempt a quiz (all question types) Given I entered the quiz activity "Quiz 2" on course "Course 1" as "student1" in the app When I press "Attempt quiz now" in the app From 4bf8eda9d10651f56dec005b4e18bd2dde426565 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 18 Apr 2023 09:56:51 +0200 Subject: [PATCH 2/3] MOBILE-4270 glossary: Skip 3.9 unsupported tests --- src/addons/mod/glossary/tests/behat/basic_usage.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/addons/mod/glossary/tests/behat/basic_usage.feature b/src/addons/mod/glossary/tests/behat/basic_usage.feature index 4d2e0d270..d1f7946db 100644 --- a/src/addons/mod/glossary/tests/behat/basic_usage.feature +++ b/src/addons/mod/glossary/tests/behat/basic_usage.feature @@ -154,6 +154,7 @@ Feature: Test basic usage of glossary in app Then I should find "Garlic" in the app And I should find "Allium sativum" in the app + @lms_from3.10 Scenario: Edit entries Given I entered the glossary activity "Test glossary" on course "Course 1" as "student1" in the app @@ -270,6 +271,7 @@ Feature: Test basic usage of glossary in app But I should not find "stub2.txt" in the app And I should not find "Brassica oleracea var. italica" in the app + @lms_from3.10 Scenario: Delete entries Given I entered the glossary activity "Test glossary" on course "Course 1" as "student1" in the app From 25f2018cc41c0f27dc43dbd1b486d1c452ce1df3 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 18 Apr 2023 09:59:18 +0200 Subject: [PATCH 3/3] MOBILE-4270 grades: Document duplicated tests --- src/core/features/grades/tests/behat/navigation-401.feature | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/features/grades/tests/behat/navigation-401.feature b/src/core/features/grades/tests/behat/navigation-401.feature index 483e1adb1..b6b3c6b1b 100644 --- a/src/core/features/grades/tests/behat/navigation-401.feature +++ b/src/core/features/grades/tests/behat/navigation-401.feature @@ -35,6 +35,8 @@ Feature: Grades navigation | GI C2.1.2 | student1 | 20 | | GI C2.2.1 | student1 | 40 | + # This scenario is duplicated from main because teacher gradebook is not supported + # in 4.1. It tests the grades from participants profile instead. Scenario: Mobile navigation (teacher) Given I entered the course "Course 2" as "teacher1" in the app @@ -78,6 +80,8 @@ Feature: Grades navigation Then I should not find "Weight" in the app And I should not find "Percentage" in the app + # This scenario is duplicated from main because teacher gradebook is not supported + # in 4.1. It tests the grades from participants profile instead. Scenario: Tablet navigation (teacher) Given I entered the course "Course 2" as "teacher1" in the app And I change viewport size to "1200x640"