From a9da44ebeba0667a7d135e387c8ac8ad2380fac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Fri, 13 Dec 2019 12:16:40 +0100 Subject: [PATCH] MOBILE-3296 behat: Behat basic test for choice --- mod/choice/tests/behat/MyChoiceTest.feature | 63 ----------------- .../tests/behat/app_advance_usage.feature | 63 ----------------- .../tests/behat/app_basic_usage.feature | 6 +- mod/data/tests/behat/try1.feature | 46 ------------ mod/quiz/tests/behat/my_quiz_test.feature | 68 ------------------ mod/quiz/tests/behat/tryquiz.feature | 70 ------------------- 6 files changed, 1 insertion(+), 315 deletions(-) delete mode 100755 mod/choice/tests/behat/MyChoiceTest.feature delete mode 100644 mod/choice/tests/behat/app_advance_usage.feature delete mode 100755 mod/data/tests/behat/try1.feature delete mode 100755 mod/quiz/tests/behat/my_quiz_test.feature delete mode 100755 mod/quiz/tests/behat/tryquiz.feature diff --git a/mod/choice/tests/behat/MyChoiceTest.feature b/mod/choice/tests/behat/MyChoiceTest.feature deleted file mode 100755 index 3692e125e..000000000 --- a/mod/choice/tests/behat/MyChoiceTest.feature +++ /dev/null @@ -1,63 +0,0 @@ -@mod @mod_choice @app @javascript -Feature: Test basic usage in app - In order to participate in the choice while using the mobile app - As a student - I need basic choice functionality to work - - Background: - Given the following "courses" exist: - | fullname | shortname | - | Course 1 | C1 | - And the following "users" exist: - | username | - | teacher1 | - | student1 | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student1 | C1 | student | - - Scenario: Student sends their single choice - Given the following "activities" exist: - | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | - | choice | Test single choice name | Test single choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 0 | 0 | 1 | - When I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Test single choice name" in the app - And I press "Option 1" in the app - And I press "Option 2" in the app - And I press "Save my choice" in the app - And I should see "Are you sure" - And I press "OK" in the app - Then I should see "Option 1: 0" - And I should see "Option 2: 1" - And I should see "Option 3: 0" - And I should not see "Remove my choice" - - Scenario: Student sends, changes and remove their multi choice - Given the following "activities" exist: - | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | - | choice | Test multi choice name | Test multi choice description | C1 | choice2 | Option 1, Option 2, Option 3 | 1 | 1 | 1 | - When I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Test multi choice name" in the app - And I press "Option 1" in the app - And I press "Option 2" in the app - And I press "Save my choice" in the app - Then I should see "Option 1: 1" - And I should see "Option 2: 1" - And I should see "Option 3: 0" - And I should see "Remove my choice" - And I press "Option 1" in the app - And I press "Option 3" in the app - And I press "Save my choice" in the app - And I should see "Option 1: 0" - And I should see "Option 2: 1" - And I should see "Option 3: 1" - And I press "Remove my choice" in the app - And I should see "Are you sure" - And I press "OK" in the app - And I should not see "Remove my choice" - And I should see "The results are not currently viewable" \ No newline at end of file diff --git a/mod/choice/tests/behat/app_advance_usage.feature b/mod/choice/tests/behat/app_advance_usage.feature deleted file mode 100644 index 3692e125e..000000000 --- a/mod/choice/tests/behat/app_advance_usage.feature +++ /dev/null @@ -1,63 +0,0 @@ -@mod @mod_choice @app @javascript -Feature: Test basic usage in app - In order to participate in the choice while using the mobile app - As a student - I need basic choice functionality to work - - Background: - Given the following "courses" exist: - | fullname | shortname | - | Course 1 | C1 | - And the following "users" exist: - | username | - | teacher1 | - | student1 | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student1 | C1 | student | - - Scenario: Student sends their single choice - Given the following "activities" exist: - | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | - | choice | Test single choice name | Test single choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 0 | 0 | 1 | - When I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Test single choice name" in the app - And I press "Option 1" in the app - And I press "Option 2" in the app - And I press "Save my choice" in the app - And I should see "Are you sure" - And I press "OK" in the app - Then I should see "Option 1: 0" - And I should see "Option 2: 1" - And I should see "Option 3: 0" - And I should not see "Remove my choice" - - Scenario: Student sends, changes and remove their multi choice - Given the following "activities" exist: - | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | - | choice | Test multi choice name | Test multi choice description | C1 | choice2 | Option 1, Option 2, Option 3 | 1 | 1 | 1 | - When I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Test multi choice name" in the app - And I press "Option 1" in the app - And I press "Option 2" in the app - And I press "Save my choice" in the app - Then I should see "Option 1: 1" - And I should see "Option 2: 1" - And I should see "Option 3: 0" - And I should see "Remove my choice" - And I press "Option 1" in the app - And I press "Option 3" in the app - And I press "Save my choice" in the app - And I should see "Option 1: 0" - And I should see "Option 2: 1" - And I should see "Option 3: 1" - And I press "Remove my choice" in the app - And I should see "Are you sure" - And I press "OK" in the app - And I should not see "Remove my choice" - And I should see "The results are not currently viewable" \ No newline at end of file diff --git a/mod/choice/tests/behat/app_basic_usage.feature b/mod/choice/tests/behat/app_basic_usage.feature index 6f04b01a5..dc3d45e7e 100755 --- a/mod/choice/tests/behat/app_basic_usage.feature +++ b/mod/choice/tests/behat/app_basic_usage.feature @@ -25,7 +25,7 @@ Feature: Test basic usage in app | choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | @3.8.0 @OK - Scenario: Student sends their single choice, views results and sync. + Scenario: Student sends their single choice and views results. Given the following "activities" exist: | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | | choice | Test single choice name | Test single choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 0 | 0 | 1 | @@ -42,14 +42,11 @@ Feature: Test basic usage in app And I should see "Option 2: 1" And I should see "Option 3: 0" And I should not see "Remove my choice" - And I pause And I press "arrow back" in the app And I press "Test single choice name" in the app And I should see "Option 1: 0" And I should see "Option 2: 1" And I should see "Option 3: 0" - And I - And I pause @3.8.0 @OK Scenario: Student sends, changes and remove their multi choice @@ -104,4 +101,3 @@ Feature: Test basic usage in app And I press "Download in text format" And I close the browser tab opened by the app - diff --git a/mod/data/tests/behat/try1.feature b/mod/data/tests/behat/try1.feature deleted file mode 100755 index 295e8b099..000000000 --- a/mod/data/tests/behat/try1.feature +++ /dev/null @@ -1,46 +0,0 @@ -@mod @mod_data @app @javascript -Feature: Trying options moodle mobile - - Background: - Given the following "users" exist: - | username | firstname | lastname | email | - | student1 | Student | 1 | student1@example.com | - | student2 | Student | 2 | student2@example.com | - | teacher1 | Teacher | 1 | teacher1@example.com | - And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student1 | C1 | student | - | student2 | C1 | student | - And the following "activities" exist: - | activity | name | intro | course | idnumber | - | data | Web links | Useful links | C1 | data1 | - - Scenario: Teacher create an event - When I enter the app - And I log in as "teacher1" - And I press "calendar" in the app - And I press "close" in the app - And I set the field "name" to "Holidays!" - And I press "No selection" in the app - And I press "Course 1" in the app - Then I press "Show more..." in the app - And I set the field "location" to "Moodle" - And I press "Save" in the app - - Scenario: Student change his moodle language - When I enter the app - And I log in as "student1" - And I press "more" near "Timeline" in the app - And I press "App settings" in the app - And I press "General" in the app - And I press "Language" in the app - And I press "EspaƱol" in the app - And I pause - And I press "Text size" in the app - And I pause - - diff --git a/mod/quiz/tests/behat/my_quiz_test.feature b/mod/quiz/tests/behat/my_quiz_test.feature deleted file mode 100755 index 23130378b..000000000 --- a/mod/quiz/tests/behat/my_quiz_test.feature +++ /dev/null @@ -1,68 +0,0 @@ -@mod @mod_quiz @app @javascript -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 | - And the following "course enrolments" exist: - | user | course | role | - | student1 | C1 | student | - 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 | - - @app_upto3.7.0 - Scenario: Next and previous navigation in the 3.6 app - Given I enter the app - And I log in as "student1" - When I press "Course 1" near "Course overview" in the app - And I press "Quiz 1" in the app - And I press "Attempt quiz now" in the app - Then I should see "Text of the first question" - And I should not see "Text of the second question" - And I press "Next" near "Question 1" in the app - And I should see "Text of the second question" - And I should not see "Text of the first question" - And I press "Previous" near "Question 2" in the app - And I should not see "Text of the second question" - And I should see "Text of the first question" - And I press "Next" near "Quiz 1" in the app - And I should see "Text of the second question" - And I should not see "Text of the first question" - And I press "Previous" near "Quiz 1" in the app - And I should not see "Text of the second question" - And I should see "Text of the first question" - And I press "Next" near "Question 1" in the app - And I press "Next" near "Quiz 1" in the app - And I should see "Summary of attempt" - And I press "Return to attempt" in the app - And I should see "Text of the second question" - And I should not see "Text of the first question" - And I press "Next" in the app - And I press "Submit all and finish" in the app - And I should see "Once you submit" - And I press "Cancel" near "Once you submit" in the app - And I should see "Summary of attempt" - And I press "Submit all and finish" in the app - And I press "OK" near "Once you submit" in the app - And I should see "Review" - And I press "home" in the app - And I should see "Acceptance test site" \ No newline at end of file diff --git a/mod/quiz/tests/behat/tryquiz.feature b/mod/quiz/tests/behat/tryquiz.feature deleted file mode 100755 index dd633b92a..000000000 --- a/mod/quiz/tests/behat/tryquiz.feature +++ /dev/null @@ -1,70 +0,0 @@ -@mod @mod_quiz @app @javascript -Feature: Trying quizzes in app - As a student - In order to demonstrate what I know - I need to be able to attempt quizzes - As a teacher - I need to see the results - - 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 | teacher | - 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 | - - @app_from3.7.1 - Scenario: Student attempt a quiz in app and teacher see the results. - Given I enter the app - And I log in as "student1" - When I press "Course 1" near "Course overview" in the app - And I press "Quiz 1" in the app - And I press "Attempt quiz now" in the app - Then I should see "Text of the first question" - And I should not see "Text of the second question" - And I press "True" in the app - And I press "Next" near "Question 1" in the app - And I should see "Text of the second question" - And I should not see "Text of the first question" - And I press "False" in the app - And I press "Clear my choice" in the app - And I press "True" in the app - And I press "Next" in the app - And I press "Submit all and finish" in the app - And I should see "OK" - And I press "OK" in the app - And I should see "Review" - Given I enter the app - And I log in as "teacher1" - When I press "Course 1" near "Course overview" in the app - And I press "Quiz 1" in the app - And I press "Information" in the app - And I press "Open in browser" in the app - And I switch to the browser tab opened by the app - And I log in as "teacher1" - And I press "Actions menu" - And I follow "Results" - And I press "Download" - And I pause - And I close the browser tab opened by the app - \ No newline at end of file