From 2ea009c474eaf1dd1695f16c081e0cff1bc09761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 11 Dec 2019 11:51:52 +0100 Subject: [PATCH 01/61] MOBILE-3295 behat: Behat basic test for forum --- mod/forum/tests/behat/app_basic_usage.feature | 157 +++++++++++++++++- 1 file changed, 156 insertions(+), 1 deletion(-) mode change 100644 => 100755 mod/forum/tests/behat/app_basic_usage.feature diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature old mode 100644 new mode 100755 index 099472334..02dd888bf --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -11,12 +11,16 @@ Feature: Test basic usage in app And the following "users" exist: | username | | student1 | + | teacher1 | + | teacher2 | And the following "course enrolments" exist: | user | course | role | | student1 | C1 | student | + | teacher1 | C1 | editingteacher | + | teacher2 | C1 | editingteacher | And the following "activities" exist: | activity | name | intro | course | idnumber | groupmode | - | forum | Test forum name | Test forum | C1 | forum | 0 | + | forum | Test forum name | Test forum | C1 | forum | 0 | Scenario: Student starts a discussion When I enter the app @@ -78,3 +82,154 @@ Feature: Test basic usage in app And I should see "Add a new discussion topic" And I close the browser tab opened by the app And I press the back button in the app + + @mobile @latest + Scenario: Student star a discussion + 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 forum name" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test star" in the app + And I set the field "Message" to "Auto-test star message" in the app + And I press "Post to forum" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test" in the app + And I set the field "Message" to "Auto-test message" in the app + And I press "Post to forum" in the app + And I press "Auto-test star" in the app + And I wait "1" seconds + And I press "Information" in the app + And I press "Star this discussion" in the app + And I press "arrow back" in the app + And I should see "Auto-test star" + And I should see "Auto-test" + And I pause + And I press "Auto-test star" in the app + And I wait "1" seconds + And I press "Information" in the app + And I press "Unstar this discussion" in the app + And I press "arrow back" in the app + Then I should see "Auto-test star" + And I should see "Auto-test" + And I pause + + + @mobile @latest + Scenario: Teacher star and pin a discussion + When I enter the app + And I log in as "teacher1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test star" in the app + And I set the field "Message" to "Auto-test star message" in the app + And I press "Post to forum" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test pin" in the app + And I set the field "Message" to "Auto-test pin message" in the app + And I press "Post to forum" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test" in the app + And I set the field "Message" to "Auto-test message" in the app + And I press "Post to forum" in the app + And I press "Auto-test star" in the app + And I wait "1" seconds + And I press "Information" in the app + And I press "Star this discussion" in the app + And I press "arrow back" in the app + And I press "Auto-test pin" in the app + And I wait "1" seconds + And I press "Information" in the app + And I press "Pin this discussion" in the app + And I press "arrow back" in the app + And I should see "Auto-test pin" + And I should see "Auto-test star" + And I should see "Auto-test" + And I pause + And I press "Auto-test pin" in the app + And I wait "1" seconds + And I press "Information" in the app + And I press "Unpin this discussion" in the app + And I press "arrow back" in the app + And I press "Auto-test star" in the app + And I wait "1" seconds + And I press "Information" in the app + And I press "Unstar this discussion" in the app + And I press "arrow back" in the app + Then I should see "Auto-test star" + And I should see "Auto-test pin" + And I pause + +@mobile @3.6 @OK + Scenario: Teacher checks pin and star in 3.6 + When I enter the app + And I log in as "teacher1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test" in the app + And I set the field "Message" to "Auto-test message" in the app + And I press "Post to forum" in the app + And I press "Auto-test" in the app + And I wait "1" seconds + And I press "Information" in the app + Then I should not see "Star this discussion" + And I should not see "Pin this discussion" + + + @mobile + Scenario: Edit a forum post (only online) + When I enter the app + And I log in as "teacher1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test" in the app + And I set the field "Message" to "Auto-test message" in the app + And I press "Post to forum" in the app + Then I should see "Auto-test" + And I should see "Auto-test message" + And I press "Auto-test" in the app + And I press "Auto-test message" in the app + And I press "Information" in the app + And I pause + And I pause + And I press "Information" near "Test forum name" in the app + And I switch to the browser tab opened by the app + And I log in as "admin" + And I press "Actions menu" + And I follow "Edit settings" + And I press "Ratings" + + + @mobile @latest + Scenario: Add/view ratings + 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 forum name" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test" in the app + And I set the field "Message" to "Auto-test message" in the app + And I press "Post to forum" in the app + And I pause + And I press "Information" near "Test forum name" 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 "admin" + And I press "Actions menu" + And I follow "Edit settings" + And I press "Ratings" + And I press "No ratings" + And I press "Average of ratings" + And I press "None" + And I press "Point" + And I press "Save and display" + And I pause + When I enter the app + And I log in as "teacher1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + And I press "Auto-test" in the app + And I pause From df1e61a955b87be7562ddf25576ddf551a8b36b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 11 Dec 2019 12:03:05 +0100 Subject: [PATCH 02/61] MOBILE-3296 behat: Behat basic test for choice --- .../tests/behat/app_advance_usage.feature | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 mod/choice/tests/behat/app_advance_usage.feature diff --git a/mod/choice/tests/behat/app_advance_usage.feature b/mod/choice/tests/behat/app_advance_usage.feature new file mode 100644 index 000000000..3692e125e --- /dev/null +++ b/mod/choice/tests/behat/app_advance_usage.feature @@ -0,0 +1,63 @@ +@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 From ca18c677e21dfcde301fc5ca1256415d1b6d8529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Fri, 13 Dec 2019 11:47:53 +0100 Subject: [PATCH 03/61] MOBILE-3297 behat: Behat basic test for survey --- mod/choice/tests/behat/MyChoiceTest.feature | 63 ++++++ .../tests/behat/app_basic_usage.feature | 70 ++++-- mod/data/tests/behat/app_data_entries.feature | 199 ++---------------- mod/data/tests/behat/app_data_sync.feature | 0 mod/data/tests/behat/try1.feature | 46 ++++ .../tests/behat/app_quiz_navigation.feature | 1 + mod/quiz/tests/behat/my_quiz_test.feature | 68 ++++++ mod/quiz/tests/behat/tryquiz.feature | 70 ++++++ .../tests/behat/app_basic_usage.feature | 86 ++++++++ 9 files changed, 414 insertions(+), 189 deletions(-) create mode 100755 mod/choice/tests/behat/MyChoiceTest.feature mode change 100644 => 100755 mod/choice/tests/behat/app_basic_usage.feature mode change 100644 => 100755 mod/data/tests/behat/app_data_entries.feature mode change 100644 => 100755 mod/data/tests/behat/app_data_sync.feature create mode 100755 mod/data/tests/behat/try1.feature mode change 100644 => 100755 mod/quiz/tests/behat/app_quiz_navigation.feature create mode 100755 mod/quiz/tests/behat/my_quiz_test.feature create mode 100755 mod/quiz/tests/behat/tryquiz.feature create mode 100755 mod/survey/tests/behat/app_basic_usage.feature diff --git a/mod/choice/tests/behat/MyChoiceTest.feature b/mod/choice/tests/behat/MyChoiceTest.feature new file mode 100755 index 000000000..3692e125e --- /dev/null +++ b/mod/choice/tests/behat/MyChoiceTest.feature @@ -0,0 +1,63 @@ +@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 old mode 100644 new mode 100755 index d6054ad60..6f04b01a5 --- a/mod/choice/tests/behat/app_basic_usage.feature +++ b/mod/choice/tests/behat/app_basic_usage.feature @@ -5,19 +5,27 @@ Feature: Test basic usage in app 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 | + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | teacher | teacher1@example.com | + | student1 | Student | student | student1@example.com | + | student2 | Student | 2 | student2@example.com | + | student3 | Student | 3 | student3@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 | + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + | student2 | C1 | student | + | student3 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | option | + | choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | - Scenario: Student sends their single choice + @3.8.0 @OK + Scenario: Student sends their single choice, views results and sync. 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 | @@ -34,8 +42,17 @@ 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 - Scenario: Student sends, changes and remove their multi choice + @3.8.0 @OK + 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 | @@ -58,6 +75,33 @@ Feature: Test basic usage in app 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 press "Delete" in the app And I should not see "Remove my choice" And I should see "The results are not currently viewable" + + + @3.8.0 @OK + Scenario: Download student choice in text format + 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 "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 + When I enter the app + And I log in as "teacher1" + And I press "Course 1" near "Course overview" in the app + And I press "Choice name" 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 "View 1 responses" + And I press "Download in text format" + And I close the browser tab opened by the app + + diff --git a/mod/data/tests/behat/app_data_entries.feature b/mod/data/tests/behat/app_data_entries.feature old mode 100644 new mode 100755 index 793f1fb38..2517342ef --- a/mod/data/tests/behat/app_data_entries.feature +++ b/mod/data/tests/behat/app_data_entries.feature @@ -1,8 +1,5 @@ @mod @mod_data @app @javascript -Feature: Users can manage entries in database activities - In order to populate databases - As a user - I need to add and manage entries to databases +Feature: Trying options moodle mobile Background: Given the following "users" exist: @@ -21,179 +18,29 @@ Feature: Users can manage entries in database activities And the following "activities" exist: | activity | name | intro | course | idnumber | | data | Web links | Useful links | C1 | data1 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I add a "Text input" field to "Web links" database and I fill the form with: - | Field name | URL | - | Field description | URL link | - And I add a "Text input" field to "Web links" database and I fill the form with: - | Field name | Description | - | Field description | Link description | - And I log out - - Scenario: Students can add entries to a database in the app + + Scenario: Teacher create an event Given I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - And I should see "No entries in database" - When I press "Add entries" in the app - And I set the field "URL" to "https://moodle.org/" in the app - And I set the field "Description" to "Moodle community site" in the app - And I press "Save" near "Web links" in the app - Then I should see "https://moodle.org/" - And I should see "Moodle community site" + When 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: Students can navigate along single entries in the app + Scenario: Student change his moodle language Given I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - And I press "Add entries" in the app - And I set the field "URL" to "https://moodle.org/" in the app - And I set the field "Description" to "Moodle community site" in the app - And I press "Save" near "Web links" in the app - When I enter the app - And I log in as "student2" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - And I press "Add entries" in the app - And I set the field "URL" to "https://moodlecloud.com/" in the app - And I set the field "Description" to "Moodle Cloud" in the app - And I press "Save" near "Web links" in the app - And I press "More" near "Moodle community site" in the app - Then I should see "Moodle community site" - And I should not see "Next" - And I should see "Previous" - And I press "Previous" in the app - And I should see "Moodle Cloud" - And I should see "Next" - And I should not see "Previous" - And I press "Next" in the app - And I should see "Moodle community site" - And I should not see "Moodle Cloud" - And I press "back" near "Web links" in the app - And I should see "Moodle community site" - And I should see "Moodle Cloud" + When 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" near "Español" in the app + And I pause + - Scenario: Students can not edit or delete other user's entries from list and single view in the app - Given I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - And I press "Add entries" in the app - And I set the field "URL" to "https://moodle.org/" in the app - And I set the field "Description" to "Moodle community site" in the app - And I press "Save" near "Web links" in the app - When I enter the app - And I log in as "student2" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - Then "Edit" "link" should not exist - And "Delete" "link" should not exist - And I press "More" in the app - And "Edit" "link" should not exist - And "Delete" "link" should not exist - - Scenario: Students can edit and delete their own entries from list and single view in the app - Given I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - And I press "Add entries" in the app - And I set the field "URL" to "https://moodle.org/" in the app - And I set the field "Description" to "Moodle community site" in the app - And I press "Save" near "Web links" in the app - When I press "Edit" in the app - And I set the field "URL" to "https://moodlecloud.com/" in the app - And I set the field "Description" to "Moodle Cloud" in the app - And I press "Save" near "Web links" in the app - Then I should not see "https://moodle.org/" - And I should not see "Moodle community site" - And I should see "https://moodlecloud.com/" - And I should see "Moodle Cloud" - And I press "Delete" in the app - And I should see "Are you sure you want to delete this entry?" - And I press "Cancel" in the app - And I should see "Moodle Cloud" - And I press "Delete" in the app - And I should see "Are you sure you want to delete this entry?" - And I press "OK" in the app - And I should not see "Moodle Cloud" - And I press "Add entries" in the app - And I set the field "URL" to "https://moodle.org/" in the app - And I set the field "Description" to "Moodle community site" in the app - And I press "Save" near "Web links" in the app - And I press "More" in the app - And I press "Edit" in the app - And I set the field "URL" to "https://moodlecloud.com/" in the app - And I set the field "Description" to "Moodle Cloud" in the app - And I press "Save" near "Web links" in the app - And I should not see "https://moodle.org/" - And I should not see "Moodle community site" - And I should see "https://moodlecloud.com/" - And I should see "Moodle Cloud" - And I press "Delete" in the app - And I should see "Are you sure you want to delete this entry?" - And I press "Cancel" in the app - And I should see "Moodle Cloud" - And I press "Delete" in the app - And I should see "Are you sure you want to delete this entry?" - And I press "OK" in the app - And I should not see "Moodle Cloud" - And I should see "No entries in database" - - Scenario: Teachers can edit and delete students' entries from list view in the app - Given I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - And I press "Add entries" in the app - And I set the field "URL" to "https://moodle.org/" in the app - And I set the field "Description" to "Moodle community site" in the app - And I press "Save" near "Web links" in the app - And I press "Add entries" in the app - And I set the field "URL" to "https://telegram.org/" in the app - And I set the field "Description" to "Telegram" in the app - And I press "Save" near "Web links" in the app - When I enter the app - And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - Then I should see "https://moodle.org/" - And I should see "Moodle community site" - And I press "Edit" near "Moodle community site" in the app - And I set the field "URL" to "https://moodlecloud.com/" in the app - And I set the field "Description" to "Moodle Cloud" in the app - And I press "Save" near "Web links" in the app - And I should not see "https://moodle.org/" - And I should not see "Moodle community site" - And I should see "https://moodlecloud.com/" - And I should see "Moodle Cloud" - And I press "Delete" near "Moodle Cloud" in the app - And I should see "Are you sure you want to delete this entry?" - And I press "Cancel" in the app - And I should see "Moodle Cloud" - And I press "Delete" near "Moodle Cloud" in the app - And I should see "Are you sure you want to delete this entry?" - And I press "OK" in the app - And I should not see "Moodle Cloud" - And I press "More" in the app - And I should see "https://telegram.org/" - And I should see "Telegram" - And I press "Edit" in the app - And I set the field "URL" to "https://moodlecloud.com/" in the app - And I set the field "Description" to "Moodle Cloud" in the app - And I press "Save" near "Web links" in the app - And I should not see "https://telegram.org/" - And I should not see "Telegram" - And I should see "https://moodlecloud.com/" - And I should see "Moodle Cloud" - And I press "Delete" in the app - And I should see "Are you sure you want to delete this entry?" - And I press "Cancel" in the app - And I should see "Moodle Cloud" - And I press "Delete" in the app - And I should see "Are you sure you want to delete this entry?" - And I press "OK" in the app - And I should not see "Moodle Cloud" diff --git a/mod/data/tests/behat/app_data_sync.feature b/mod/data/tests/behat/app_data_sync.feature old mode 100644 new mode 100755 diff --git a/mod/data/tests/behat/try1.feature b/mod/data/tests/behat/try1.feature new file mode 100755 index 000000000..295e8b099 --- /dev/null +++ b/mod/data/tests/behat/try1.feature @@ -0,0 +1,46 @@ +@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/app_quiz_navigation.feature b/mod/quiz/tests/behat/app_quiz_navigation.feature old mode 100644 new mode 100755 index 630ce0feb..63c0e71be --- a/mod/quiz/tests/behat/app_quiz_navigation.feature +++ b/mod/quiz/tests/behat/app_quiz_navigation.feature @@ -106,4 +106,5 @@ Feature: Attempt a quiz in app And I should see "Are you sure" And I should see "OK" And I press "OK" in the app + And I pause And I should see "Acceptance test site" \ No newline at end of file diff --git a/mod/quiz/tests/behat/my_quiz_test.feature b/mod/quiz/tests/behat/my_quiz_test.feature new file mode 100755 index 000000000..23130378b --- /dev/null +++ b/mod/quiz/tests/behat/my_quiz_test.feature @@ -0,0 +1,68 @@ +@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 new file mode 100755 index 000000000..dd633b92a --- /dev/null +++ b/mod/quiz/tests/behat/tryquiz.feature @@ -0,0 +1,70 @@ +@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 diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature new file mode 100755 index 000000000..957c2fd09 --- /dev/null +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -0,0 +1,86 @@ +@mod @mod_survey @app @javascript +Feature: Test basic usage in app + In order to participate in surveys while using the mobile app + As a student + I need basic forum functionality to work + + 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 | groupmode | + | survey | Test survey name | Test survey | C1 | survey | 0 | + + @Mobile @3.8.0 @OK + Scenario: Student answer a survey and see results + 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 survey name" in the app + And I press "Choose" near "1. In evaluating what someone says, I focus on the quality of their argument, not on the person who's presenting it." in the app + And I press "Strongly agree" in the app + And I press "Choose" near "2. I like playing devil's advocate - arguing the opposite of what someone is saying." in the app + And I press "Strongly disagree" in the app + And I press "Choose" near "3. I like to understand where other people are 'coming from', what experiences have led them to feel the way they do." in the app + And I press "Somewhat agree" in the app + And I press "Choose" near "4. The most important part of my education has been learning to understand people who are very different to me." in the app + And I press "Somewhat disagree" in the app + And I press "Choose" near "5. I feel that the best way for me to achieve my own identity is to interact with a variety of other people." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "6. I enjoy hearing the opinions of people who come from backgrounds different to mine - it helps me to understand how the same things can be seen in such different ways." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "7. I find that I can strengthen my own position through arguing with someone who disagrees with me." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "8. I am always interested in knowing why people say and believe the things they do." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "9. I often find myself arguing with the authors of books that I read, trying to logically figure out why they're wrong." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "10. It's important for me to remain as objective as possible when I analyze something." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "11. I try to think with people instead of against them." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "12. I have certain criteria I use in evaluating arguments." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "13. I'm more likely to try to understand someone else's opinion than to try to evaluate it." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "14. I try to point out weaknesses in other people's thinking to help them clarify their arguments." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "15. I tend to put myself in other people's shoes when discussing controversial issues, to see why they think the way they do." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "16. One could call my way of analysing things 'putting them on trial' because I am careful to consider all the evidence." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "17. I value the use of logic and reason over the incorporation of my own concerns when solving problems." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "18. I can obtain insight into opinions that differ from mine through empathy." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "19. When I encounter people whose opinions seem alien to me, I make a deliberate effort to 'extend' myself into that person, to try to see how they could have those opinions." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Choose" near "20. I spend time figuring out what's 'wrong' with things. For example, I'll look for something in a literary interpretation that isn't argued well enough." in the app + And I press "Somewhat agree" near "Neither agree nor disagree" in the app + And I press "Submit" in the app + And I press "OK" in the app + And I press "open" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + + @Tablet @3.8.0 + Scenario: Student answer a survey and see results tablet + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + And I press "Course 1" near "Course overview" in the app + And I press "Test survey name" in the app + And I pause + + 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 04/61] 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 From 46cdf1daab3a8b28fe3eec0fa498a4cfa9e5bc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 16 Dec 2019 12:03:41 +0100 Subject: [PATCH 05/61] MOBILE-3296 behat: Behat basic test for choice --- .../tests/behat/app_basic_usage.feature | 87 +++++++++++++++++-- 1 file changed, 80 insertions(+), 7 deletions(-) diff --git a/mod/choice/tests/behat/app_basic_usage.feature b/mod/choice/tests/behat/app_basic_usage.feature index dc3d45e7e..80e1086ae 100755 --- a/mod/choice/tests/behat/app_basic_usage.feature +++ b/mod/choice/tests/behat/app_basic_usage.feature @@ -9,8 +9,6 @@ Feature: Test basic usage in app | username | firstname | lastname | email | | teacher1 | Teacher | teacher | teacher1@example.com | | student1 | Student | student | student1@example.com | - | student2 | Student | 2 | student2@example.com | - | student3 | Student | 3 | student3@example.com | And the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | @@ -18,8 +16,6 @@ Feature: Test basic usage in app | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - | student2 | C1 | student | - | student3 | C1 | student | And the following "activities" exist: | activity | name | intro | course | idnumber | option | | choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | @@ -49,7 +45,7 @@ Feature: Test basic usage in app And I should see "Option 3: 0" @3.8.0 @OK - Scenario: Student sends, changes and remove their multi choice + Scenario: Student sends, changes and removes the 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 | @@ -76,9 +72,87 @@ Feature: Test basic usage in app And I should not see "Remove my choice" And I should see "The results are not currently viewable" + @3.8.0 @OK + Scenario: Student answers, changes answer offline and sync + 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 switch offline mode to "true" + 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 + And I press "arrow back" in the app + And I press "Test single choice name" in the app + And I switch offline mode to "false" + And I press "arrow back" in the app + And I press "Test single choice name" 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" @3.8.0 @OK - Scenario: Download student choice in text format + Scenario: Student answers, changes answer offline and auto-sync + 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 switch offline mode to "true" + 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 + And I switch offline mode to "false" + And I wait "600" seconds + 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" + + @3.8.0 @OK + Scenario: Prefetch + 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 "Information" in the app + And I press "Show download options" in the app + And I press "cloud download" near "Test single choice name" in the app + And I switch offline mode to "true" + And I press "Choice name" in the app + And I should see "There was a problem connecting to the site. Please check your connection and try again." + And I press "OK" in the app + And I press "arrow back" 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 + And I press "arrow back" in the app + And I press "Test single choice name" in the app + And I switch offline mode to "false" + And I press "arrow back" in the app + And I press "Test single choice name" 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" + + @3.8.0 @OK + Scenario: Download students choice in text format When I enter the app And I log in as "student1" And I press "Course 1" near "Course overview" in the app @@ -100,4 +174,3 @@ Feature: Test basic usage in app And I follow "View 1 responses" And I press "Download in text format" And I close the browser tab opened by the app - From d571a9a32e2f9dd7ff016c1ae52c32315f9537bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Fri, 20 Dec 2019 18:27:54 +0100 Subject: [PATCH 06/61] MOBILE-3295 behat: Behat basic test for forum --- mod/forum/tests/behat/app_basic_usage.feature | 256 +++++++++++++++--- 1 file changed, 223 insertions(+), 33 deletions(-) diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index 02dd888bf..145ba3261 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -11,16 +11,18 @@ Feature: Test basic usage in app And the following "users" exist: | username | | student1 | + | student2 | | teacher1 | | teacher2 | And the following "course enrolments" exist: | user | course | role | | student1 | C1 | student | + | student2 | C1 | student | | teacher1 | C1 | editingteacher | | teacher2 | C1 | editingteacher | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Test forum name | Test forum | C1 | forum | 0 | + | activity | name | intro | course | idnumber | groupmode | assessed | scale[modgrade_type] | + | forum | Test forum name | Test forum | C1 | forum | 0 | 5 | Point | Scenario: Student starts a discussion When I enter the app @@ -83,7 +85,7 @@ Feature: Test basic usage in app And I close the browser tab opened by the app And I press the back button in the app - @mobile @latest + @app @mobile @3.8.0 Scenario: Student star a discussion When I enter the app And I log in as "student1" @@ -115,7 +117,7 @@ Feature: Test basic usage in app And I pause - @mobile @latest + @app @mobile @3.8.0 Scenario: Teacher star and pin a discussion When I enter the app And I log in as "teacher1" @@ -161,7 +163,7 @@ Feature: Test basic usage in app And I should see "Auto-test pin" And I pause -@mobile @3.6 @OK + @app @mobile @3.6 @OK Scenario: Teacher checks pin and star in 3.6 When I enter the app And I log in as "teacher1" @@ -178,10 +180,10 @@ Feature: Test basic usage in app And I should not see "Pin this discussion" - @mobile + @app @mobile @3.8.0 Scenario: Edit a forum post (only online) When I enter the app - And I log in as "teacher1" + And I log in as "student1" And I press "Course 1" near "Course overview" in the app And I press "Test forum name" in the app And I press "close" in the app @@ -189,21 +191,21 @@ Feature: Test basic usage in app And I set the field "Message" to "Auto-test message" in the app And I press "Post to forum" in the app Then I should see "Auto-test" - And I should see "Auto-test message" - And I press "Auto-test" in the app - And I press "Auto-test message" in the app + And I press "arrow back" in the app And I press "Information" in the app + And I press "Show download options" in the app + And I press "cloud download" near "Test forum name" in the app + And I press "Test forum name" in the app + And I press "Auto-test" in the app + And I wait "2" seconds + And I pause + And I press "More" in the app + And I should see "Edit" + And I pause + And I switch offline mode to "true" And I pause - And I pause - And I press "Information" near "Test forum name" in the app - And I switch to the browser tab opened by the app - And I log in as "admin" - And I press "Actions menu" - And I follow "Edit settings" - And I press "Ratings" - - @mobile @latest + @app @mobile @3.8.0 Scenario: Add/view ratings When I enter the app And I log in as "student1" @@ -213,23 +215,211 @@ Feature: Test basic usage in app And I set the field "Subject" to "Auto-test" in the app And I set the field "Message" to "Auto-test message" in the app And I press "Post to forum" in the app - And I pause - And I press "Information" near "Test forum name" 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 "admin" - And I press "Actions menu" - And I follow "Edit settings" - And I press "Ratings" - And I press "No ratings" - And I press "Average of ratings" - And I press "None" - And I press "Point" - And I press "Save and display" - And I pause + And I press "Auto-test" in the app + And I press "Reply" in the app + And I set the field "Write your reply..." to "test" in the app + And I press "Post to forum" in the app When I enter the app And I log in as "teacher1" And I press "Course 1" near "Course overview" in the app And I press "Test forum name" in the app And I press "Auto-test" in the app And I pause + + @app @3.8.0 @mobile @OK + Scenario: Student replies a post offline mobile + 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 forum name" in the app + And I press "Add a new discussion topic" in the app + And I set the field "Subject" to "DiscussionSubject" in the app + And I set the field "Message" to "DiscussionMessage" in the app + And I press "Post to forum" in the app + And I press "arrow back" in the app + And I press "Information" in the app + And I press "Show download options" in the app + And I press "cloud download" near "Test forum name" in the app + And I press "Test forum name" in the app + And I press "DiscussionSubject" in the app + And I switch offline mode to "true" + And I press "Reply" in the app + And I set the field "Write your reply" to "ReplyMessage" in the app + And I press "Post to forum" in the app + Then I should see "DiscussionMessage" + And I should see "ReplyMessage" + And I should see "Not sent" + And I press "arrow back" in the app + And I switch offline mode to "false" + And I press "DiscussionSubject" in the app + Then I should see "DiscussionMessage" + And I should see "ReplyMessage" + And I should not see "Not sent" + + @app @3.8.0 @tablet @OK + Scenario: Student replies a post offline tablet + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + And I press "Add a new discussion topic" in the app + And I set the field "Subject" to "DiscussionSubject" in the app + And I set the field "Message" to "DiscussionMessage" in the app + And I press "Post to forum" in the app + And I press "arrow back" in the app + And I press "Information" in the app + And I press "Show download options" in the app + And I press "cloud download" near "Test forum name" in the app + And I press "Test forum name" in the app + And I press "DiscussionSubject" near "Sort by last post creation date in descending order" in the app + And I switch offline mode to "true" + And I press "Reply" in the app + And I set the field "Write your reply" to "ReplyMessage" in the app + And I press "Post to forum" in the app + Then I should see "DiscussionMessage" + And I should see "ReplyMessage" + And I should see "Not sent" + And I press "arrow back" in the app + And I switch offline mode to "false" + And I press "Test forum name" in the app + And I press "DiscussionSubject" near "Sort by last post creation date in descending order" in the app + Then I should see "DiscussionMessage" + And I should see "ReplyMessage" + And I should not see "Not sent" + + @app @3.8.0 @OK + Scenario: Student creates a new discussion offline and sync forum + 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 forum name" in the app + And I switch offline mode to "true" + And I press "Add a new discussion topic" in the app + And I set the field "Subject" to "DiscussionSubject" in the app + And I set the field "Message" to "DiscussionMessage" in the app + And I press "Post to forum" in the app + Then I should see "DiscussionSubject" + And I should see "Not sent" + And I switch offline mode to "false" + And I press "arrow back" in the app + And I press "Test forum name" in the app + And I press "Information" in the app + And I press "Refresh discussions" in the app + And I press "DiscussionSubject" near "Sort by last post creation date in descending order" in the app + Then I should see "DiscussionSubject" + And I should see "DiscussionMessage" + And I should not see "Not sent" + + @app @3.8.0 @OK + Scenario: Student creates a new discussion offline and auto-sync forum + 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 forum name" in the app + And I switch offline mode to "true" + And I press "Add a new discussion topic" in the app + And I set the field "Subject" to "DiscussionSubject" in the app + And I set the field "Message" to "DiscussionMessage" in the app + And I press "Post to forum" in the app + Then I should see "DiscussionSubject" + And I should see "Not sent" + And I switch offline mode to "false" + And I wait "600" seconds + And I should not see "Not sent" + And I press "DiscussionSubject" near "Sort by last post creation date in descending order" in the app + Then I should see "DiscussionSubject" + And I should see "DiscussionMessage" + And I should not see "Not sent" + + @app @3.8.0 @mobile @OK + Scenario: Prefetch mobile + 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 forum name" in the app + And I press "Add a new discussion topic" in the app + And I set the field "Subject" to "DiscussionSubject" in the app + And I set the field "Message" to "DiscussionMessage" in the app + And I press "Post to forum" in the app + Then I should see "DiscussionSubject" + And I press "arrow back" in the app + And I press "Information" in the app + And I press "Show download options" in the app + And I press "cloud download" near "Test forum name" in the app + And I press "Test forum name" in the app + And I press "Add a new discussion topic" in the app + And I set the field "Subject" to "DiscussionSubject 2" in the app + And I set the field "Message" to "DiscussionMessage 2" in the app + And I press "Post to forum" in the app + Then I should see "DiscussionSubject" + And I should see "DiscussionSubject 2" + And I press "arrow back" in the app + And I switch offline mode to "true" + And I press "Test forum name" in the app + And I press "DiscussionSubject 2" in the app + Then I should see "There was a problem connecting to the site. Please check your connection and try again." + And I press "OK" in the app + And I press "arrow back" in the app + And I press "DiscussionSubject" in the app + Then I should see "DiscussionSubject" + And I should see "DiscussionMessage" + And I should not see "There was a problem connecting to the site. Please check your connection and try again." + + + @app @3.8.0 @tablet + Scenario: Prefetch tablet + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + And I press "Add a new discussion topic" in the app + And I set the field "Subject" to "DiscussionSubject" in the app + And I set the field "Message" to "DiscussionMessage" in the app + And I press "Post to forum" in the app + Then I should see "DiscussionSubject" + And I press "arrow back" in the app + And I press "Information" in the app + And I press "Show download options" in the app + And I press "cloud download" near "Test forum name" in the app + And I press "Test forum name" in the app + And I press "Add a new discussion topic" in the app + And I set the field "Subject" to "DiscussionSubject 2" in the app + And I set the field "Message" to "DiscussionMessage 2" in the app + And I press "Post to forum" in the app + Then I should see "DiscussionSubject" + And I should see "DiscussionSubject 2" + And I press "arrow back" in the app + And I switch offline mode to "true" + And I press "Test forum name" in the app + And I pause + And I press "DiscussionSubject 2" in the app + Then I should see "There was a problem connecting to the site. Please check your connection and try again." + And I press "OK" in the app + And I press "DiscussionSubject" in the app + Then I should see "DiscussionSubject" + And I should see "DiscussionMessage" + + @app @3.8.0 + Scenario: Student sorts a forum discussion + 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 forum name" in the app + And I press "Add a new discussion topic" in the app + And I set the field "Subject" to "DiscussionSubject" in the app + And I set the field "Message" to "DiscussionMessage" in the app + And I press "Post to forum" in the app + Then I should see "DiscussionSubject" + And I press "Add a new discussion topic" in the app + And I set the field "Subject" to "DiscussionSubject more replies" in the app + And I set the field "Message" to "DiscussionMessage more replies" in the app + And I press "Post to forum" in the app + Then I should see "DiscussionSubject" + And I should see "DiscussionSubject more replies" + And I press "DiscussionSubject more replies" in the app + And I press "Reply" in the app + And I set the field "Write your reply" to "ReplyMessage" in the app + And I press "Post to forum" in the app + And I pause \ No newline at end of file From 57cddebb3eaeef2f9a8a1e707475e1288b0aed15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 2 Jan 2020 10:06:02 +0100 Subject: [PATCH 07/61] MOBILE-3295 MOBILE-3296 behat: Behat basic test for forum and choice --- mod/forum/tests/behat/app_basic_usage.feature | 25 +++--- .../tests/behat/app_basic_usage.feature | 78 ++++++++++++++++++- 2 files changed, 88 insertions(+), 15 deletions(-) diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index 145ba3261..56a1651eb 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -85,7 +85,7 @@ Feature: Test basic usage in app And I close the browser tab opened by the app And I press the back button in the app - @app @mobile @3.8.0 + @app @3.8.0 Scenario: Student star a discussion When I enter the app And I log in as "student1" @@ -117,7 +117,7 @@ Feature: Test basic usage in app And I pause - @app @mobile @3.8.0 + @app @3.8.0 Scenario: Teacher star and pin a discussion When I enter the app And I log in as "teacher1" @@ -163,7 +163,7 @@ Feature: Test basic usage in app And I should see "Auto-test pin" And I pause - @app @mobile @3.6 @OK + @app @3.6 @OK Scenario: Teacher checks pin and star in 3.6 When I enter the app And I log in as "teacher1" @@ -180,7 +180,7 @@ Feature: Test basic usage in app And I should not see "Pin this discussion" - @app @mobile @3.8.0 + @app @3.8.0 Scenario: Edit a forum post (only online) When I enter the app And I log in as "student1" @@ -199,13 +199,13 @@ Feature: Test basic usage in app And I press "Auto-test" in the app And I wait "2" seconds And I pause - And I press "More" in the app + And I press "" in the app And I should see "Edit" And I pause And I switch offline mode to "true" And I pause - @app @mobile @3.8.0 + @app @3.8.0 Scenario: Add/view ratings When I enter the app And I log in as "student1" @@ -367,7 +367,7 @@ Feature: Test basic usage in app And I should not see "There was a problem connecting to the site. Please check your connection and try again." - @app @3.8.0 @tablet + @app @3.8.0 @tablet @OK Scenario: Prefetch tablet When I enter the app And I change viewport size to "1280x1080" @@ -392,15 +392,18 @@ Feature: Test basic usage in app And I should see "DiscussionSubject 2" And I press "arrow back" in the app And I switch offline mode to "true" - And I press "Test forum name" in the app - And I pause - And I press "DiscussionSubject 2" in the app + And I press "refresh" near "Test forum name" in the app Then I should see "There was a problem connecting to the site. Please check your connection and try again." And I press "OK" in the app + And I press "Test forum name" in the app And I press "DiscussionSubject" in the app Then I should see "DiscussionSubject" And I should see "DiscussionMessage" - + And I press "arrow back" in the app + And I switch offline mode to "false" + And I press "refresh" near "Test forum name" in the app + Then I should not see "There was a problem connecting to the site. Please check your connection and try again." + @app @3.8.0 Scenario: Student sorts a forum discussion When I enter the app diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature index 957c2fd09..390cafdde 100755 --- a/mod/survey/tests/behat/app_basic_usage.feature +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -20,8 +20,8 @@ Feature: Test basic usage in app | activity | name | intro | course | idnumber | groupmode | | survey | Test survey name | Test survey | C1 | survey | 0 | - @Mobile @3.8.0 @OK - Scenario: Student answer a survey and see results + @app @3.8.0 @mobile @OK + Scenario: Student answers a survey ATTLS and see results mobile When I enter the app And I log in as "student1" And I press "Course 1" near "Course overview" in the app @@ -74,13 +74,83 @@ Feature: Test basic usage in app Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." And I should see "1 people have completed this survey so far" - @Tablet @3.8.0 - Scenario: Student answer a survey and see results tablet + @app @3.8.0 @tablet + Scenario: Student answer a survey ATTLS and see results tablet When I enter the app And I change viewport size to "1280x1080" And I log in as "student1" And I press "Course 1" near "Course overview" in the app And I press "Test survey name" in the app And I pause + + @app @3.8.0 + Scenario: Student answers a survey of critical incidents and see results + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 | + 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 survey critical incidents" in the app + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "Results" + And I press "Results" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "Test survey critical incidents" + And I pause + + @app @3.8.0 @OK + Scenario: Sync survey + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 | + 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 survey critical incidents" in the app + And I switch offline mode to "true" + And I press "Submit" in the app + And I press "OK" in the app + And I switch offline mode to "false" + And I press "arrow back" in the app + And I press "Test survey critical incidents" in the app + And I press "Information" in the app + And I press "Refresh" in the app + Then I should see "Results" + + + @app @3.8.0 @OK + Scenario: Prefetch and auto-sync + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 | + 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 "Information" in the app + And I press "Show download options" in the app + And I press "cloud download" near "Test survey critical incidents" in the app + And I switch offline mode to "true" + And I press "Test survey name" in the app + Then I should see "There was a problem connecting to the site. Please check your connection and try again." + And I press "OK" in the app + And I press "arrow back" in the app + And I press "Test survey critical incidents" in the app + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "This Survey has offline data to be synchronised." + And I switch offline mode to "false" + And I wait "600" seconds + Then I should not see "This Survey has offline data to be synchronised." + And I should see "You have completed this survey." + + + @app @3.8.0 + Scenario: Student answers a survey offline + When I enter the app + And I log in as "student1" + And I pause From 6ae980be6a3179296db6873b26ef952ed967b02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 8 Jan 2020 09:19:19 +0100 Subject: [PATCH 08/61] MOBILE-3297 behat: Behat basic test for survey finished --- .../tests/behat/app_basic_usage.feature | 474 +++++++++++++++++- 1 file changed, 457 insertions(+), 17 deletions(-) diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature index 390cafdde..a2d3aae30 100755 --- a/mod/survey/tests/behat/app_basic_usage.feature +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -2,7 +2,7 @@ Feature: Test basic usage in app In order to participate in surveys while using the mobile app As a student - I need basic forum functionality to work + I need basic survey functionality to work Background: Given the following "courses" exist: @@ -74,16 +74,43 @@ Feature: Test basic usage in app Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." And I should see "1 people have completed this survey so far" - @app @3.8.0 @tablet - Scenario: Student answer a survey ATTLS and see results tablet + @app @3.8.0 @tablet @OK + Scenario: Student answers a survey ATTLS and see results tablet When I enter the app And I change viewport size to "1280x1080" And I log in as "student1" And I press "Course 1" near "Course overview" in the app And I press "Test survey name" in the app - And I pause + And I press "1. In evaluating what someone says, I focus on the quality of their argument, not on the person who's presenting it." in the app + And I press "2. I like playing devil's advocate - arguing the opposite of what someone is saying." in the app + And I press "3. I like to understand where other people are 'coming from', what experiences have led them to feel the way they do." in the app + And I press "4. The most important part of my education has been learning to understand people who are very different to me." in the app + And I press "5. I feel that the best way for me to achieve my own identity is to interact with a variety of other people." in the app + And I press "6. I enjoy hearing the opinions of people who come from backgrounds different to mine - it helps me to understand how the same things can be seen in such different ways." in the app + And I press "7. I find that I can strengthen my own position through arguing with someone who disagrees with me." in the app + And I press "8. I am always interested in knowing why people say and believe the things they do." in the app + And I press "9. I often find myself arguing with the authors of books that I read, trying to logically figure out why they're wrong." in the app + And I press "10. It's important for me to remain as objective as possible when I analyze something." in the app + And I press "11. I try to think with people instead of against them." in the app + And I press "12. I have certain criteria I use in evaluating arguments." in the app + And I press "13. I'm more likely to try to understand someone else's opinion than to try to evaluate it." in the app + And I press "14. I try to point out weaknesses in other people's thinking to help them clarify their arguments." in the app + And I press "15. I tend to put myself in other people's shoes when discussing controversial issues, to see why they think the way they do." in the app + And I press "16. One could call my way of analysing things 'putting them on trial' because I am careful to consider all the evidence." in the app + And I press "17. I value the use of logic and reason over the incorporation of my own concerns when solving problems." in the app + And I press "18. I can obtain insight into opinions that differ from mine through empathy." in the app + And I press "19. When I encounter people whose opinions seem alien to me, I make a deliberate effort to 'extend' myself into that person, to try to see how they could have those opinions." in the app + And I press "20. I spend time figuring out what's 'wrong' with things. For example, I'll look for something in a literary interpretation that isn't argued well enough." in the app + And I press "Submit" in the app + And I press "OK" in the app + And I press "open" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" - @app @3.8.0 + + @app @3.8.0 @OK Scenario: Student answers a survey of critical incidents and see results Given the following "activities" exist: | activity | name | intro | template |course | idnumber | groupmode | @@ -99,10 +126,432 @@ Feature: Test basic usage in app And I switch to the browser tab opened by the app And I log in as "student1" Then I should see "Test survey critical incidents" - And I pause + + @app @3.8.0 @mobile @OK + Scenario: Student answers a survey of Colles (actual) and see results mobile + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey Colles (actual) | Test survey1 | 1 | C1 | survey1 | 0 | + 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 survey Colles (actual)" in the app + And I press "Choose" near "1. my learning focuses on issues that interest me." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "2. what I learn is important for my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "3. I learn how to improve my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "4. what I learn connects well with my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "5. I think critically about how I learn." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "6. I think critically about my own ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "7. I think critically about other students' ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "8. I think critically about ideas in the readings." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "9. I explain my ideas to other students." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "10. I ask other students to explain their ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "11. other students ask me to explain my ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "12. other students respond to my ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "13. the tutor stimulates my thinking." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "14. the tutor encourages me to participate." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "15. the tutor models good discourse." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "16. the tutor models critical self-reflection." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "17. other students encourage my participation." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "18. other students praise my contribution." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "19. other students value my contribution." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "20. other students empathise with my struggle to learn." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "21. I make good sense of other students' messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "22. other students make good sense of my messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "23. I make good sense of the tutor's messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "24. the tutor makes good sense of my messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "25. How long did this survey take you to complete?" in the app + And I press "under 1 min" in the app + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "You have completed this survey" + And I should see "Results" + And I press "Results" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + + @app @3.8.0 @tablet @OK + Scenario: Student answers a survey of Colles (actual) and see results tablet + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey Colles (actual) | Test survey1 | 1 | C1 | survey1 | 0 | + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + And I press "Course 1" near "Course overview" in the app + And I press "Test survey Colles (actual)" in the app + And I press "1. my learning focuses on issues that interest me." in the app + And I press "2. what I learn is important for my professional practice." in the app + And I press "3. I learn how to improve my professional practice." in the app + And I press "4. what I learn connects well with my professional practice." in the app + And I press "5. I think critically about how I learn." in the app + And I press "6. I think critically about my own ideas." in the app + And I press "7. I think critically about other students' ideas." in the app + And I press "8. I think critically about ideas in the readings." in the app + And I press "9. I explain my ideas to other students." in the app + And I press "10. I ask other students to explain their ideas." in the app + And I press "11. other students ask me to explain my ideas." in the app + And I press "12. other students respond to my ideas." in the app + And I press "13. the tutor stimulates my thinking." in the app + And I press "14. the tutor encourages me to participate." in the app + And I press "15. the tutor models good discourse." in the app + And I press "16. the tutor models critical self-reflection." in the app + And I press "17. other students encourage my participation." in the app + And I press "18. other students praise my contribution." in the app + And I press "19. other students value my contribution." in the app + And I press "20. other students empathise with my struggle to learn." in the app + And I press "21. I make good sense of other students' messages." in the app + And I press "22. other students make good sense of my messages." in the app + And I press "23. I make good sense of the tutor's messages." in the app + And I press "24. the tutor makes good sense of my messages." in the app + And I press "25. How long did this survey take you to complete?" in the app + And I press "under 1 min" in the app + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "You have completed this survey" + And I should see "Results" + And I press "Results" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + + + @app @3.8.0 @mobile @OK + Scenario: Student answers a survey of Colles (preferred) and see results mobile + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey Colles (preferred) | Test survey1 | 2 | C1 | survey1 | 0 | + 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 survey Colles (preferred)" in the app + And I press "Choose" near "1. my learning focuses on issues that interest me." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "2. what I learn is important for my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "3. I learn how to improve my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "4. what I learn connects well with my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "5. I think critically about how I learn." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "6. I think critically about my own ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "7. I think critically about other students' ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "8. I think critically about ideas in the readings." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "9. I explain my ideas to other students." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "10. I ask other students to explain their ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "11. other students ask me to explain my ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "12. other students respond to my ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "13. the tutor stimulates my thinking." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "14. the tutor encourages me to participate." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "15. the tutor models good discourse." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "16. the tutor models critical self-reflection." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "17. other students encourage my participation." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "18. other students praise my contribution." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "19. other students value my contribution." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "20. other students empathise with my struggle to learn." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "21. I make good sense of other students' messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "22. other students make good sense of my messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "23. I make good sense of the tutor's messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "24. the tutor makes good sense of my messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "25. How long did this survey take you to complete?" in the app + And I press "under 1 min" in the app + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "You have completed this survey" + And I should see "Results" + And I press "Results" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + + + @app @3.8.0 @tablet @OK + Scenario: Student answers a survey of Colles (preferred) and see results tablet + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey Colles (preferred) | Test survey1 | 2 | C1 | survey1 | 0 | + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + And I press "Course 1" near "Course overview" in the app + And I press "Test survey Colles (preferred)" in the app + And I press "1. my learning focuses on issues that interest me." in the app + And I press "2. what I learn is important for my professional practice." in the app + And I press "3. I learn how to improve my professional practice." in the app + And I press "4. what I learn connects well with my professional practice." in the app + And I press "5. I think critically about how I learn." in the app + And I press "6. I think critically about my own ideas." in the app + And I press "7. I think critically about other students' ideas." in the app + And I press "8. I think critically about ideas in the readings." in the app + And I press "9. I explain my ideas to other students." in the app + And I press "10. I ask other students to explain their ideas." in the app + And I press "11. other students ask me to explain my ideas." in the app + And I press "12. other students respond to my ideas." in the app + And I press "13. the tutor stimulates my thinking." in the app + And I press "14. the tutor encourages me to participate." in the app + And I press "15. the tutor models good discourse." in the app + And I press "16. the tutor models critical self-reflection." in the app + And I press "17. other students encourage my participation." in the app + And I press "18. other students praise my contribution." in the app + And I press "19. other students value my contribution." in the app + And I press "20. other students empathise with my struggle to learn." in the app + And I press "21. I make good sense of other students' messages." in the app + And I press "22. other students make good sense of my messages." in the app + And I press "23. I make good sense of the tutor's messages." in the app + And I press "24. the tutor makes good sense of my messages." in the app + And I press "25. How long did this survey take you to complete?" in the app + And I press "under 1 min" in the app + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "You have completed this survey" + And I should see "Results" + And I press "Results" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + + + + @app @3.8.0 @mobile @OK + Scenario: Student answers a survey of Colles (preferred and actual) and see results mobile + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey Colles (preferred and actual) | Test survey1 | 3 | C1 | survey1 | 0 | + 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 survey Colles (preferred and actual)" in the app + And I press "Choose" near "1. I prefer that my learning focuses on issues that interest me." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "2. I found that my learning focuses on issues that interest me." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "3. I prefer that what I learn is important for my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "4. I found that what I learn is important for my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "5. I prefer that I learn how to improve my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "6. I found that I learn how to improve my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "7. I prefer that what I learn connects well with my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "8. I found that what I learn connects well with my professional practice." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "9. I prefer that I think critically about how I learn." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "10. I found that I think critically about how I learn." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "11. I prefer that I think critically about my own ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "12. I found that I think critically about my own ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "13. I prefer that I think critically about other students' ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "14. I found that I think critically about other students' ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "15. I prefer that I think critically about ideas in the readings." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "16. I found that I think critically about ideas in the readings." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "17. I prefer that I explain my ideas to other students." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "18. I found that I explain my ideas to other students." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "19. I prefer that I ask other students to explain their ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "20. I found that I ask other students to explain their ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "21. I prefer that other students ask me to explain my ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "22. I found that other students ask me to explain my ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "23. I prefer that other students respond to my ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "24. I found that other students respond to my ideas." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "25. I prefer that the tutor stimulates my thinking." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "26. I found that the tutor stimulates my thinking." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "27. I prefer that the tutor encourages me to participate." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "28. I found that the tutor encourages me to participate." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "29. I prefer that the tutor models good discourse." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "30. I found that the tutor models good discourse." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "31. I prefer that the tutor models critical self-reflection." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "32. I found that the tutor models critical self-reflection." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "33. I prefer that other students encourage my participation." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "34. I found that other students encourage my participation." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "35. I prefer that other students praise my contribution." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "36. I found that other students praise my contribution." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "37. I prefer that other students value my contribution." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "38. I found that other students value my contribution." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "39. I prefer that other students empathise with my struggle to learn." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "40. I found that other students empathise with my struggle to learn." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "41. I prefer that I make good sense of other students' messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "42. I found that I make good sense of other students' messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "43. I prefer that other students make good sense of my messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "44. I found that other students make good sense of my messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "45. I prefer that I make good sense of the tutor's messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "46. I found that I make good sense of the tutor's messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "47. I prefer that the tutor makes good sense of my messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "48. I found that the tutor makes good sense of my messages." in the app + And I press "Sometimes" near "Often" in the app + And I press "Choose" near "49. How long did this survey take you to complete?" in the app + And I press "1-2 min" in the app + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "You have completed this survey" + And I should see "Results" + And I press "Results" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + + + @app @3.8.0 @tablet @OK + Scenario: Student answers a survey of Colles (preferred and actual) and see results tablet + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey Colles (preferred and actual) | Test survey1 | 3 | C1 | survey1 | 0 | + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + And I press "Course 1" near "Course overview" in the app + And I press "Test survey Colles (preferred and actual)" in the app + And I press "1. I prefer that my learning focuses on issues that interest me." in the app + And I press "2. I found that my learning focuses on issues that interest me." in the app + And I press "3. I prefer that what I learn is important for my professional practice." in the app + And I press "4. I found that what I learn is important for my professional practice." in the app + And I press "5. I prefer that I learn how to improve my professional practice." in the app + And I press "6. I found that I learn how to improve my professional practice." in the app + And I press "7. I prefer that what I learn connects well with my professional practice." in the app + And I press "8. I found that what I learn connects well with my professional practice." in the app + And I press "9. I prefer that I think critically about how I learn." in the app + And I press "10. I found that I think critically about how I learn." in the app + And I press "11. I prefer that I think critically about my own ideas." in the app + And I press "12. I found that I think critically about my own ideas." in the app + And I press "13. I prefer that I think critically about other students' ideas." in the app + And I press "14. I found that I think critically about other students' ideas." in the app + And I press "15. I prefer that I think critically about ideas in the readings." in the app + And I press "16. I found that I think critically about ideas in the readings." in the app + And I press "17. I prefer that I explain my ideas to other students." in the app + And I press "18. I found that I explain my ideas to other students." in the app + And I press "19. I prefer that I ask other students to explain their ideas." in the app + And I press "20. I found that I ask other students to explain their ideas." in the app + And I press "21. I prefer that other students ask me to explain my ideas." in the app + And I press "22. I found that other students ask me to explain my ideas." in the app + And I press "23. I prefer that other students respond to my ideas." in the app + And I press "24. I found that other students respond to my ideas." in the app + And I press "25. I prefer that the tutor stimulates my thinking." in the app + And I press "26. I found that the tutor stimulates my thinking." in the app + And I press "27. I prefer that the tutor encourages me to participate." in the app + And I press "28. I found that the tutor encourages me to participate." in the app + And I press "29. I prefer that the tutor models good discourse." in the app + And I press "30. I found that the tutor models good discourse." in the app + And I press "31. I prefer that the tutor models critical self-reflection." in the app + And I press "32. I found that the tutor models critical self-reflection." in the app + And I press "33. I prefer that other students encourage my participation." in the app + And I press "34. I found that other students encourage my participation." in the app + And I press "35. I prefer that other students praise my contribution." in the app + And I press "36. I found that other students praise my contribution." in the app + And I press "37. I prefer that other students value my contribution." in the app + And I press "38. I found that other students value my contribution." in the app + And I press "39. I prefer that other students empathise with my struggle to learn." in the app + And I press "40. I found that other students empathise with my struggle to learn." in the app + And I press "41. I prefer that I make good sense of other students' messages." in the app + And I press "42. I found that I make good sense of other students' messages." in the app + And I press "43. I prefer that other students make good sense of my messages." in the app + And I press "44. I found that other students make good sense of my messages." in the app + And I press "45. I prefer that I make good sense of the tutor's messages." in the app + And I press "46. I found that I make good sense of the tutor's messages." in the app + And I press "47. I prefer that the tutor makes good sense of my messages." in the app + And I press "48. I found that the tutor makes good sense of my messages." in the app + And I press "49. How long did this survey take you to complete?" in the app + And I press "1-2 min" in the app + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "You have completed this survey" + And I should see "Results" + And I press "Results" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + @app @3.8.0 @OK - Scenario: Sync survey + Scenario: Student answers a survey offline and sync survey Given the following "activities" exist: | activity | name | intro | template |course | idnumber | groupmode | | survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 | @@ -144,13 +593,4 @@ Feature: Test basic usage in app And I switch offline mode to "false" And I wait "600" seconds Then I should not see "This Survey has offline data to be synchronised." - And I should see "You have completed this survey." - - - @app @3.8.0 - Scenario: Student answers a survey offline - When I enter the app - And I log in as "student1" - And I pause - - + And I should see "You have completed this survey." \ No newline at end of file From 78619e16896fc7de81bb1c59dc6b54869e30271a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 9 Jan 2020 12:03:12 +0100 Subject: [PATCH 09/61] MOBILE-3295 MOBILE-3296 MOBILE-3297 behat: Improvements on forum, survey and choice --- .../tests/behat/app_basic_usage.feature | 36 +++++++++++++------ mod/forum/tests/behat/app_basic_usage.feature | 27 +++++++++----- .../tests/behat/app_basic_usage.feature | 6 ++-- 3 files changed, 47 insertions(+), 22 deletions(-) diff --git a/mod/choice/tests/behat/app_basic_usage.feature b/mod/choice/tests/behat/app_basic_usage.feature index 80e1086ae..5b703e00f 100755 --- a/mod/choice/tests/behat/app_basic_usage.feature +++ b/mod/choice/tests/behat/app_basic_usage.feature @@ -1,5 +1,5 @@ @mod @mod_choice @app @javascript -Feature: Test basic usage in app +Feature: Test basic usage of choice activity in app In order to participate in the choice while using the mobile app As a student I need basic choice functionality to work @@ -20,7 +20,7 @@ Feature: Test basic usage in app | activity | name | intro | course | idnumber | option | | choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | - @3.8.0 @OK + @app @3.8.0 @OK Scenario: Student sends their single choice and views results. Given the following "activities" exist: | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | @@ -44,7 +44,7 @@ Feature: Test basic usage in app And I should see "Option 2: 1" And I should see "Option 3: 0" - @3.8.0 @OK + @app @3.8.0 @OK Scenario: Student sends, changes and removes the multi choice Given the following "activities" exist: | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | @@ -72,7 +72,7 @@ Feature: Test basic usage in app And I should not see "Remove my choice" And I should see "The results are not currently viewable" - @3.8.0 @OK + @app @3.8.0 @OK Scenario: Student answers, changes answer offline and sync Given the following "activities" exist: | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | @@ -85,19 +85,25 @@ Feature: Test basic usage in app And I switch offline mode to "true" And I press "Option 2" in the app And I press "Save my choice" in the app - And I should see "Are you sure" + Then I should see "Are you sure" And I press "OK" in the app And I press "arrow back" in the app And I press "Test single choice name" in the app + Then I should not see "Option 1: 0" + And I should not see "Option 2: 1" + And I should not see "Option 3: 0" + And I should see "This Choice has offline data to be synchronised." And I switch offline mode to "false" And I press "arrow back" in the app And I press "Test single choice name" in the app + And I press "Information" in the app + And I press "Refresh" 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" + And I should not see "This Choice has offline data to be synchronised." - @3.8.0 @OK + @app @3.8.0 @OK Scenario: Student answers, changes answer offline and auto-sync Given the following "activities" exist: | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | @@ -113,13 +119,17 @@ Feature: Test basic usage in app And I should see "Are you sure" And I press "OK" in the app And I switch offline mode to "false" + Then I should not see "Option 1: 0" + And I should not see "Option 2: 1" + And I should not see "Option 3: 0" + And I should see "This Choice has offline data to be synchronised." And I wait "600" seconds 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" + And I should not see "This Choice has offline data to be synchronised." - @3.8.0 @OK + @app @3.8.0 @OK Scenario: Prefetch Given the following "activities" exist: | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | @@ -143,15 +153,19 @@ Feature: Test basic usage in app And I press "OK" in the app And I press "arrow back" in the app And I press "Test single choice name" in the app + And I should not see "Option 1: 0" + And I should not see "Option 2: 1" + And I should not see "Option 3: 0" + And I should see "This Choice has offline data to be synchronised." And I switch offline mode to "false" And I press "arrow back" in the app And I press "Test single choice name" 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" + And I should not see "This Choice has offline data to be synchronised." - @3.8.0 @OK + @app @3.8.0 @OK Scenario: Download students choice in text format When I enter the app And I log in as "student1" diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index 56a1651eb..d37a232f2 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -1,5 +1,5 @@ @mod @mod_forum @app @javascript -Feature: Test basic usage in app +Feature: Test basic usage of forum activity in app In order to participate in the forum while using the mobile app As a student I need basic forum functionality to work @@ -24,6 +24,7 @@ Feature: Test basic usage in app | activity | name | intro | course | idnumber | groupmode | assessed | scale[modgrade_type] | | forum | Test forum name | Test forum | C1 | forum | 0 | 5 | Point | + @app @3.8.0 @OK Scenario: Student starts a discussion When I enter the app And I log in as "student1" @@ -34,8 +35,10 @@ Feature: Test basic usage in app And I set the field "Message" to "An awesome message" in the app And I press "Post to forum" in the app Then I should see "My happy subject" + And I press "My happy subject" in the app And I should see "An awesome message" + @app_upto3.6.1 Scenario: Student posts a reply When I enter the app @@ -70,6 +73,7 @@ Feature: Test basic usage in app Then I should see "DiscussionMessage" And I should see "ReplyMessage" + @OK Scenario: Test that 'open in browser' works for forum When I enter the app And I change viewport size to "360x640" @@ -85,7 +89,7 @@ Feature: Test basic usage in app And I close the browser tab opened by the app And I press the back button in the app - @app @3.8.0 + @app @mobile @3.8.0 Scenario: Student star a discussion When I enter the app And I log in as "student1" @@ -104,7 +108,7 @@ Feature: Test basic usage in app And I press "Information" in the app And I press "Star this discussion" in the app And I press "arrow back" in the app - And I should see "Auto-test star" + Then I should see "Auto-test star" And I should see "Auto-test" And I pause And I press "Auto-test star" in the app @@ -117,7 +121,7 @@ Feature: Test basic usage in app And I pause - @app @3.8.0 + @app @mobile @3.8.0 Scenario: Teacher star and pin a discussion When I enter the app And I log in as "teacher1" @@ -163,7 +167,7 @@ Feature: Test basic usage in app And I should see "Auto-test pin" And I pause - @app @3.6 @OK + @app @mobile @3.6 @OK Scenario: Teacher checks pin and star in 3.6 When I enter the app And I log in as "teacher1" @@ -180,7 +184,7 @@ Feature: Test basic usage in app And I should not see "Pin this discussion" - @app @3.8.0 + @app @mobile @3.8.0 Scenario: Edit a forum post (only online) When I enter the app And I log in as "student1" @@ -199,13 +203,14 @@ Feature: Test basic usage in app And I press "Auto-test" in the app And I wait "2" seconds And I pause - And I press "" in the app + And I press "Auto-test" near "Information" in the app + And I pause And I should see "Edit" And I pause And I switch offline mode to "true" And I pause - @app @3.8.0 + @app @mobile @3.8.0 Scenario: Add/view ratings When I enter the app And I log in as "student1" @@ -220,7 +225,7 @@ Feature: Test basic usage in app And I set the field "Write your reply..." to "test" in the app And I press "Post to forum" in the app When I enter the app - And I log in as "teacher1" + And I log in as "student2" And I press "Course 1" near "Course overview" in the app And I press "Test forum name" in the app And I press "Auto-test" in the app @@ -301,6 +306,7 @@ Feature: Test basic usage in app And I press "Post to forum" in the app Then I should see "DiscussionSubject" And I should see "Not sent" + And I should see "This Forum has offline data to be synchronised." And I switch offline mode to "false" And I press "arrow back" in the app And I press "Test forum name" in the app @@ -310,6 +316,7 @@ Feature: Test basic usage in app Then I should see "DiscussionSubject" And I should see "DiscussionMessage" And I should not see "Not sent" + And I should not see "This Forum has offline data to be synchronised." @app @3.8.0 @OK Scenario: Student creates a new discussion offline and auto-sync forum @@ -324,6 +331,7 @@ Feature: Test basic usage in app And I press "Post to forum" in the app Then I should see "DiscussionSubject" And I should see "Not sent" + And I should see "This Forum has offline data to be synchronised." And I switch offline mode to "false" And I wait "600" seconds And I should not see "Not sent" @@ -331,6 +339,7 @@ Feature: Test basic usage in app Then I should see "DiscussionSubject" And I should see "DiscussionMessage" And I should not see "Not sent" + And I should not see "This Forum has offline data to be synchronised." @app @3.8.0 @mobile @OK Scenario: Prefetch mobile diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature index a2d3aae30..90ad4668a 100755 --- a/mod/survey/tests/behat/app_basic_usage.feature +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -1,5 +1,5 @@ @mod @mod_survey @app @javascript -Feature: Test basic usage in app +Feature: Test basic usage of survey activity in app In order to participate in surveys while using the mobile app As a student I need basic survey functionality to work @@ -562,13 +562,15 @@ Feature: Test basic usage in app And I switch offline mode to "true" And I press "Submit" in the app And I press "OK" in the app + Then I should see "This Survey has offline data to be synchronised." And I switch offline mode to "false" And I press "arrow back" in the app And I press "Test survey critical incidents" in the app And I press "Information" in the app And I press "Refresh" in the app Then I should see "Results" - + And I should not see "This Survey has offline data to be synchronised." + And I should see "You have completed this survey." @app @3.8.0 @OK Scenario: Prefetch and auto-sync From 65581ad89cb84b12f8af80abad5df8bed27bf1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 15 Jan 2020 11:30:51 +0100 Subject: [PATCH 10/61] MOBILE-3295 MOBILE-3296 MOBILE-3297 behat: Improvements on forum, survey and choice --- .../tests/behat/app_basic_usage.feature | 12 ++-- mod/forum/tests/behat/app_basic_usage.feature | 70 ++++++++++--------- .../tests/behat/app_basic_usage.feature | 5 +- 3 files changed, 46 insertions(+), 41 deletions(-) diff --git a/mod/choice/tests/behat/app_basic_usage.feature b/mod/choice/tests/behat/app_basic_usage.feature index 5b703e00f..5167bd33a 100755 --- a/mod/choice/tests/behat/app_basic_usage.feature +++ b/mod/choice/tests/behat/app_basic_usage.feature @@ -38,7 +38,7 @@ Feature: Test basic usage of choice activity 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 press "arrow back" in the app + And I press the back button 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" @@ -87,14 +87,14 @@ Feature: Test basic usage of choice activity in app And I press "Save my choice" in the app Then I should see "Are you sure" And I press "OK" in the app - And I press "arrow back" in the app + And I press the back button in the app And I press "Test single choice name" in the app Then I should not see "Option 1: 0" And I should not see "Option 2: 1" And I should not see "Option 3: 0" And I should see "This Choice has offline data to be synchronised." And I switch offline mode to "false" - And I press "arrow back" in the app + And I press the back button in the app And I press "Test single choice name" in the app And I press "Information" in the app And I press "Refresh" in the app @@ -144,21 +144,21 @@ Feature: Test basic usage of choice activity in app And I press "Choice name" in the app And I should see "There was a problem connecting to the site. Please check your connection and try again." And I press "OK" in the app - And I press "arrow back" in the app + And I press the back button 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 - And I press "arrow back" in the app + And I press the back button in the app And I press "Test single choice name" in the app And I should not see "Option 1: 0" And I should not see "Option 2: 1" And I should not see "Option 3: 0" And I should see "This Choice has offline data to be synchronised." And I switch offline mode to "false" - And I press "arrow back" in the app + And I press the back button in the app And I press "Test single choice name" in the app Then I should see "Option 1: 0" And I should see "Option 2: 1" diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index d37a232f2..48cea02da 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -73,7 +73,6 @@ Feature: Test basic usage of forum activity in app Then I should see "DiscussionMessage" And I should see "ReplyMessage" - @OK Scenario: Test that 'open in browser' works for forum When I enter the app And I change viewport size to "360x640" @@ -90,7 +89,7 @@ Feature: Test basic usage of forum activity in app And I press the back button in the app @app @mobile @3.8.0 - Scenario: Student star a discussion + Scenario: Student stars a discussion When I enter the app And I log in as "student1" And I press "Course 1" near "Course overview" in the app @@ -99,27 +98,32 @@ Feature: Test basic usage of forum activity in app And I set the field "Subject" to "Auto-test star" in the app And I set the field "Message" to "Auto-test star message" in the app And I press "Post to forum" in the app + And I wait "60" seconds And I press "close" in the app - And I set the field "Subject" to "Auto-test" in the app - And I set the field "Message" to "Auto-test message" in the app + And I set the field "Subject" to "Auto-test star" in the app + And I set the field "Message" to "Auto-test no star message" in the app And I press "Post to forum" in the app - And I press "Auto-test star" in the app - And I wait "1" seconds + And I press "Auto-test star" near "Last post a minute ago" in the app + Then I should see "Auto-test star message" And I press "Information" in the app And I press "Star this discussion" in the app - And I press "arrow back" in the app - Then I should see "Auto-test star" - And I should see "Auto-test" - And I pause - And I press "Auto-test star" in the app + And I press the back button in the app + And I press "Auto-test star" near "Last post a minute ago" in the app + Then I should see "Auto-test star message" + And I press the back button in the app + And I press "Auto-test star" near "Last post a few seconds ago" in the app + Then I should see "Auto-test no star message" + And I press the back button in the app + And I press "Auto-test star" near "Last post a minute ago" in the app And I wait "1" seconds And I press "Information" in the app And I press "Unstar this discussion" in the app - And I press "arrow back" in the app - Then I should see "Auto-test star" - And I should see "Auto-test" - And I pause - + And I press the back button in the app + And I press "Auto-test star" near "Last post a few seconds ago" in the app + Then I should see "Auto-test no star message" + And I press the back button in the app + And I press "Auto-test star" near "Last post a minute ago" in the app + Then I should see "Auto-test star message" @app @mobile @3.8.0 Scenario: Teacher star and pin a discussion @@ -143,12 +147,12 @@ Feature: Test basic usage of forum activity in app And I wait "1" seconds And I press "Information" in the app And I press "Star this discussion" in the app - And I press "arrow back" in the app + And I press the back button in the app And I press "Auto-test pin" in the app And I wait "1" seconds And I press "Information" in the app And I press "Pin this discussion" in the app - And I press "arrow back" in the app + And I press the back button in the app And I should see "Auto-test pin" And I should see "Auto-test star" And I should see "Auto-test" @@ -157,12 +161,12 @@ Feature: Test basic usage of forum activity in app And I wait "1" seconds And I press "Information" in the app And I press "Unpin this discussion" in the app - And I press "arrow back" in the app + And I press the back button in the app And I press "Auto-test star" in the app And I wait "1" seconds And I press "Information" in the app And I press "Unstar this discussion" in the app - And I press "arrow back" in the app + And I press the back button in the app Then I should see "Auto-test star" And I should see "Auto-test pin" And I pause @@ -195,7 +199,7 @@ Feature: Test basic usage of forum activity in app And I set the field "Message" to "Auto-test message" in the app And I press "Post to forum" in the app Then I should see "Auto-test" - And I press "arrow back" in the app + And I press the back button in the app And I press "Information" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app @@ -241,7 +245,7 @@ Feature: Test basic usage of forum activity in app And I set the field "Subject" to "DiscussionSubject" in the app And I set the field "Message" to "DiscussionMessage" in the app And I press "Post to forum" in the app - And I press "arrow back" in the app + And I press the back button in the app And I press "Information" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app @@ -254,7 +258,7 @@ Feature: Test basic usage of forum activity in app Then I should see "DiscussionMessage" And I should see "ReplyMessage" And I should see "Not sent" - And I press "arrow back" in the app + And I press the back button in the app And I switch offline mode to "false" And I press "DiscussionSubject" in the app Then I should see "DiscussionMessage" @@ -262,7 +266,7 @@ Feature: Test basic usage of forum activity in app And I should not see "Not sent" @app @3.8.0 @tablet @OK - Scenario: Student replies a post offline tablet + Scenario: Student replies a post offline tablet When I enter the app And I change viewport size to "1280x1080" And I log in as "student1" @@ -272,7 +276,7 @@ Feature: Test basic usage of forum activity in app And I set the field "Subject" to "DiscussionSubject" in the app And I set the field "Message" to "DiscussionMessage" in the app And I press "Post to forum" in the app - And I press "arrow back" in the app + And I press the back button in the app And I press "Information" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app @@ -285,7 +289,7 @@ Feature: Test basic usage of forum activity in app Then I should see "DiscussionMessage" And I should see "ReplyMessage" And I should see "Not sent" - And I press "arrow back" in the app + And I press the back button in the app And I switch offline mode to "false" And I press "Test forum name" in the app And I press "DiscussionSubject" near "Sort by last post creation date in descending order" in the app @@ -308,7 +312,7 @@ Feature: Test basic usage of forum activity in app And I should see "Not sent" And I should see "This Forum has offline data to be synchronised." And I switch offline mode to "false" - And I press "arrow back" in the app + And I press the back button in the app And I press "Test forum name" in the app And I press "Information" in the app And I press "Refresh discussions" in the app @@ -352,7 +356,7 @@ Feature: Test basic usage of forum activity in app And I set the field "Message" to "DiscussionMessage" in the app And I press "Post to forum" in the app Then I should see "DiscussionSubject" - And I press "arrow back" in the app + And I press the back button in the app And I press "Information" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app @@ -363,13 +367,13 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app Then I should see "DiscussionSubject" And I should see "DiscussionSubject 2" - And I press "arrow back" in the app + And I press the back button in the app And I switch offline mode to "true" And I press "Test forum name" in the app And I press "DiscussionSubject 2" in the app Then I should see "There was a problem connecting to the site. Please check your connection and try again." And I press "OK" in the app - And I press "arrow back" in the app + And I press the back button in the app And I press "DiscussionSubject" in the app Then I should see "DiscussionSubject" And I should see "DiscussionMessage" @@ -388,7 +392,7 @@ Feature: Test basic usage of forum activity in app And I set the field "Message" to "DiscussionMessage" in the app And I press "Post to forum" in the app Then I should see "DiscussionSubject" - And I press "arrow back" in the app + And I press the back button in the app And I press "Information" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app @@ -399,7 +403,7 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app Then I should see "DiscussionSubject" And I should see "DiscussionSubject 2" - And I press "arrow back" in the app + And I press the back button in the app And I switch offline mode to "true" And I press "refresh" near "Test forum name" in the app Then I should see "There was a problem connecting to the site. Please check your connection and try again." @@ -408,7 +412,7 @@ Feature: Test basic usage of forum activity in app And I press "DiscussionSubject" in the app Then I should see "DiscussionSubject" And I should see "DiscussionMessage" - And I press "arrow back" in the app + And I press the back button in the app And I switch offline mode to "false" And I press "refresh" near "Test forum name" in the app Then I should not see "There was a problem connecting to the site. Please check your connection and try again." diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature index 90ad4668a..08fa78a6c 100755 --- a/mod/survey/tests/behat/app_basic_usage.feature +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -252,6 +252,7 @@ Feature: Test basic usage of survey activity in app And I log in as "student1" And I press "Course 1" near "Course overview" in the app And I press "Test survey Colles (preferred)" in the app + And I pause And I press "Choose" near "1. my learning focuses on issues that interest me." in the app And I press "Sometimes" near "Often" in the app And I press "Choose" near "2. what I learn is important for my professional practice." in the app @@ -564,7 +565,7 @@ Feature: Test basic usage of survey activity in app And I press "OK" in the app Then I should see "This Survey has offline data to be synchronised." And I switch offline mode to "false" - And I press "arrow back" in the app + And I press the back button in the app And I press "Test survey critical incidents" in the app And I press "Information" in the app And I press "Refresh" in the app @@ -587,7 +588,7 @@ Feature: Test basic usage of survey activity in app And I press "Test survey name" in the app Then I should see "There was a problem connecting to the site. Please check your connection and try again." And I press "OK" in the app - And I press "arrow back" in the app + And I press the back button in the app And I press "Test survey critical incidents" in the app And I press "Submit" in the app And I press "OK" in the app From 62850ca2d9551ac6ccb804e8af68eb1f64a14e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 16 Jan 2020 11:56:45 +0100 Subject: [PATCH 11/61] MOBILE-3300 behat: Behat basic test for courses --- .../tests/behat/app_basic_usage.feature | 2 +- .../tests/behat/app_basic_usage.feature | 97 +++++++++++++++++++ mod/forum/tests/behat/app_basic_usage.feature | 3 +- .../tests/behat/app_basic_usage.feature | 11 ++- 4 files changed, 110 insertions(+), 3 deletions(-) create mode 100755 mod/courses/tests/behat/app_basic_usage.feature diff --git a/mod/choice/tests/behat/app_basic_usage.feature b/mod/choice/tests/behat/app_basic_usage.feature index 5167bd33a..24ee2e68c 100755 --- a/mod/choice/tests/behat/app_basic_usage.feature +++ b/mod/choice/tests/behat/app_basic_usage.feature @@ -187,4 +187,4 @@ Feature: Test basic usage of choice activity in app And I press "Actions menu" And I follow "View 1 responses" And I press "Download in text format" - And I close the browser tab opened by the app + And I close the browser tab opened by the app \ No newline at end of file diff --git a/mod/courses/tests/behat/app_basic_usage.feature b/mod/courses/tests/behat/app_basic_usage.feature new file mode 100755 index 000000000..168441bdf --- /dev/null +++ b/mod/courses/tests/behat/app_basic_usage.feature @@ -0,0 +1,97 @@ +@mod @mod_courses @app @javascript +Feature: Test basic usage of courses in app + In order to participate in the courses while using the mobile app + As a student + I need basic courses functionality to work + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | teacher | teacher1@example.com | + | student1 | Student | student | student1@example.com | + And the following "courses" exist: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + | Course 2 | C2 | 0 | + | Course 3 | C3 | 0 | + | Course 4 | C4 | 0 | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | teacher1 | C2 | editingteacher | + | teacher1 | C3 | editingteacher | + | teacher1 | C4 | editingteacher | + | student1 | C1 | student | + | student1 | C2 | student | + | student1 | C3 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | option | + | choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | + | choice | Choice course 2 | Test choice description | C2 | choice1 | Option 1, Option 2, Option 3 | + | choice | Choice course 3 | Test choice description | C3 | choice1 | Option 1, Option 2, Option 3 | + | choice | Choice course 4 | Test choice description | C4 | choice1 | Option 1, Option 2, Option 3 | + + @app @3.8.0 @OK + Scenario: Dashboard tab displayed in >= 3.3 sites + When I enter the app + And I log in as "student1" + Then I should see "Dashboard" + And the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I should see "Course 2" + And I should see "Course 3" + And I press "Site home" in the app + Then I should see "Dashboard" + And the header should be "Acceptance test site" in the app + And I press "Dashboard" in the app + Then I should see "Course 1" + And I should see "Course 2" + And I should see "Course 3" + + @app @3.8.0 @OK + Scenario: See my courses + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I should see "Course 2" + And I should see "Course 3" + And I press "Course 1" near "Recently accessed courses" in the app + Then I should see "Choice course 1" + And the header should be "Course 1" in the app + And I press "Choice course 1" in the app + Then I should see "Test choice description" + And the header should be "Choice course 1" in the app + And I press the back button in the app + And I press the back button in the app + And I press "Course 2" near "Recently accessed courses" in the app + Then I should see "Choice course 2" + And the header should be "Course 2" in the app + And I press the back button in the app + And I press "Course 3" near "Recently accessed courses" in the app + Then I should see "Choice course 3" + And the header should be "Course 3" in the app + + @app @3.8.0 + Scenario: Search for a course + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I should see "Course 2" + And I should see "Course 3" + And I press "Search courses" in the app + And I set the field "Search" to "Course 4" in the app + And I press "Search" in the app + Then I should see "Course 4" + And the header should be "Search courses" in the app + And I press "Course 4" in the app + Then I should see "Course 4" + And the header should be "Course 4" in the app + And I press the back button in the app + And I set the field "Search" to "Course" in the app + And I press "Search" in the app + Then I should see "Course 1" + And I should see "Course 2" + And I should see "Course 3" + And I should see "Course 4" diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index 48cea02da..9ce95940c 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -438,4 +438,5 @@ Feature: Test basic usage of forum activity in app And I press "Reply" in the app And I set the field "Write your reply" to "ReplyMessage" in the app And I press "Post to forum" in the app - And I pause \ No newline at end of file + And I pause + diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature index 08fa78a6c..f184432dc 100755 --- a/mod/survey/tests/behat/app_basic_usage.feature +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -596,4 +596,13 @@ Feature: Test basic usage of survey activity in app And I switch offline mode to "false" And I wait "600" seconds Then I should not see "This Survey has offline data to be synchronised." - And I should see "You have completed this survey." \ No newline at end of file + And I should see "You have completed this survey." + + + + + + + + + From bad325e1c5f99a12df2f6efb6117c4de50111019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 16 Jan 2020 12:07:53 +0100 Subject: [PATCH 12/61] MOBILE-3295 MOBILE-3296 MOBILE-3297 MOBILE-3300 behat: Improvements on forum, survey, choice and courses --- mod/courses/tests/behat/app_basic_usage.feature | 2 +- mod/forum/tests/behat/app_basic_usage.feature | 3 +-- mod/survey/tests/behat/app_basic_usage.feature | 11 +---------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/mod/courses/tests/behat/app_basic_usage.feature b/mod/courses/tests/behat/app_basic_usage.feature index 168441bdf..8b62c266f 100755 --- a/mod/courses/tests/behat/app_basic_usage.feature +++ b/mod/courses/tests/behat/app_basic_usage.feature @@ -94,4 +94,4 @@ Feature: Test basic usage of courses in app Then I should see "Course 1" And I should see "Course 2" And I should see "Course 3" - And I should see "Course 4" + And I should see "Course 4" \ No newline at end of file diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index 9ce95940c..48cea02da 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -438,5 +438,4 @@ Feature: Test basic usage of forum activity in app And I press "Reply" in the app And I set the field "Write your reply" to "ReplyMessage" in the app And I press "Post to forum" in the app - And I pause - + And I pause \ No newline at end of file diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature index f184432dc..08fa78a6c 100755 --- a/mod/survey/tests/behat/app_basic_usage.feature +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -596,13 +596,4 @@ Feature: Test basic usage of survey activity in app And I switch offline mode to "false" And I wait "600" seconds Then I should not see "This Survey has offline data to be synchronised." - And I should see "You have completed this survey." - - - - - - - - - + And I should see "You have completed this survey." \ No newline at end of file From 47a9180a11a9d8f8ff6ddceba88a4e53700162ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Tue, 21 Jan 2020 10:03:59 +0100 Subject: [PATCH 13/61] MOBILE-3300 behat: Behat basic tests for courses --- .../tests/behat/app_basic_usage.feature | 79 +++++++++- mod/data/tests/behat/app_data_entries.feature | 46 ------ mod/data/tests/behat/app_data_sync.feature | 136 ------------------ .../tests/behat/app_quiz_navigation.feature | 110 -------------- 4 files changed, 72 insertions(+), 299 deletions(-) delete mode 100755 mod/data/tests/behat/app_data_entries.feature delete mode 100755 mod/data/tests/behat/app_data_sync.feature delete mode 100755 mod/quiz/tests/behat/app_quiz_navigation.feature diff --git a/mod/courses/tests/behat/app_basic_usage.feature b/mod/courses/tests/behat/app_basic_usage.feature index 8b62c266f..a22581dec 100755 --- a/mod/courses/tests/behat/app_basic_usage.feature +++ b/mod/courses/tests/behat/app_basic_usage.feature @@ -9,12 +9,14 @@ Feature: Test basic usage of courses in app | username | firstname | lastname | email | | teacher1 | Teacher | teacher | teacher1@example.com | | student1 | Student | student | student1@example.com | + And the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | | Course 2 | C2 | 0 | | Course 3 | C3 | 0 | | Course 4 | C4 | 0 | + And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | @@ -24,12 +26,17 @@ Feature: Test basic usage of courses in app | student1 | C1 | student | | student1 | C2 | student | | student1 | C3 | student | + And the following "activities" exist: - | activity | name | intro | course | idnumber | option | - | choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | - | choice | Choice course 2 | Test choice description | C2 | choice1 | Option 1, Option 2, Option 3 | - | choice | Choice course 3 | Test choice description | C3 | choice1 | Option 1, Option 2, Option 3 | - | choice | Choice course 4 | Test choice description | C4 | choice1 | Option 1, Option 2, Option 3 | + | activity | name | intro | course | idnumber | option | + | choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | + | choice | Choice course 2 | Test choice description | C2 | choice1 | Option 1, Option 2, Option 3 | + | choice | Choice course 3 | Test choice description | C3 | choice1 | Option 1, Option 2, Option 3 | + | choice | Choice course 4 | Test choice description | C4 | choice1 | Option 1, Option 2, Option 3 | + + And the following "activities" exist: + | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | + | assign | C1 | assign1 | assignment | Test assignment description | 1 | @app @3.8.0 @OK Scenario: Dashboard tab displayed in >= 3.3 sites @@ -72,7 +79,7 @@ Feature: Test basic usage of courses in app Then I should see "Choice course 3" And the header should be "Course 3" in the app - @app @3.8.0 + @app @3.8.0 @OK Scenario: Search for a course When I enter the app And I log in as "student1" @@ -94,4 +101,62 @@ Feature: Test basic usage of courses in app Then I should see "Course 1" And I should see "Course 2" And I should see "Course 3" - And I should see "Course 4" \ No newline at end of file + And I should see "Course 4" + + @app @3.8.0 @OK + Scenario: Links to actions in Timeline work for teachers/students + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I should see "Course 2" + And I should see "Course 3" + And I should see "Timeline" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "assignment" 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 "Edit settings" + And I press "Expand all" + And I click on "duedate[enabled]" "checkbox" + And I click on "gradingduedate[enabled]" "checkbox" + And I press "Save and return to course" + And I close the browser tab opened by the app + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I should see "Course 2" + And I should see "Course 3" + And I should see "Timeline" + And I press "Add submission" in the app + Then the header should be "assignment" in the app + And I should see "Test assignment description" + And I should see "No attempt" + And I should see "Due date" + And I press "Add submission" in the app + And I set the field "Online text submissions" to "test" in the app + And I press "Save" in the app + And I press "Submit assignment" in the app + And I press "OK" in the app + Then the header should be "assignment" in the app + And I should see "Test assignment description" + And I should see "Submitted for grading" + And I should see "Due date" + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I should see "Course 2" + And I should see "Course 3" + And I should see "Timeline" + And I press "Grade" in the app + Then the header should be "assignment" in the app + And I should see "Test assignment description" + And I should see "Time remaining" + And I press "Needs grading" in the app + Then I should see "Student student" + And I should see "Not graded" \ No newline at end of file diff --git a/mod/data/tests/behat/app_data_entries.feature b/mod/data/tests/behat/app_data_entries.feature deleted file mode 100755 index 2517342ef..000000000 --- a/mod/data/tests/behat/app_data_entries.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 - Given I enter the app - When 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 - Given I enter the app - When 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" near "Español" in the app - And I pause - - diff --git a/mod/data/tests/behat/app_data_sync.feature b/mod/data/tests/behat/app_data_sync.feature deleted file mode 100755 index 025f1abcc..000000000 --- a/mod/data/tests/behat/app_data_sync.feature +++ /dev/null @@ -1,136 +0,0 @@ -@mod @mod_data @app @javascript -Feature: Users can store entries in database activities when offline and sync when online - In order to populate databases while offline - As a user - I need to add and manage entries to databases and sync then when online - - 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 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I add a "Text input" field to "Web links" database and I fill the form with: - | Field name | URL | - | Field description | URL link | - And I add a "Text input" field to "Web links" database and I fill the form with: - | Field name | Description | - | Field description | Link description | - And I log out - - @app_from3.7 - Scenario: Students can add entries to a database in the app while offline - Given I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - And I switch offline mode to "true" - And I should see "No entries in database" - When I press "Add entries" in the app - And I set the field "URL" to "https://moodle.org/" in the app - And I set the field "Description" to "Moodle community site" in the app - And I press "Save" near "Web links" in the app - Then I should see "https://moodle.org/" - And I should see "Moodle community site" - And I should see "This Database has offline data to be synchronised" - And I press "back" near "Web links" in the app - And I switch offline mode to "false" - And I press "Web links" near "General" in the app - And I should see "https://moodle.org/" - And I should see "Moodle community site" - And I should not see "This Database has offline data to be synchronised" - - @app_from3.7 - Scenario: Students can edit and delete entries to a database in the app while offline - Given I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - And I should see "No entries in database" - And I press "Add entries" in the app - And I set the field "URL" to "https://moodle.org/" in the app - And I set the field "Description" to "Moodle community site" in the app - And I press "Save" near "Web links" in the app - And I should see "https://moodle.org/" - And I should see "Moodle community site" - And I press "Information" in the app - And I press "Download" in the app - And I wait until the page is ready - And I switch offline mode to "true" - When I press "Edit" in the app - And I set the field "URL" to "https://moodlecloud.com/" in the app - And I set the field "Description" to "Moodle Cloud" in the app - And I press "Save" near "Web links" in the app - Then I should not see "https://moodle.org/" - And I should not see "Moodle community site" - And I should see "https://moodlecloud.com/" - And I should see "Moodle Cloud" - And I should see "This Database has offline data to be synchronised" - And I press "back" near "Web links" in the app - And I switch offline mode to "false" - And I press "Web links" near "General" in the app - And I should not see "https://moodle.org/" - And I should not see "Moodle community site" - And I should see "https://moodlecloud.com/" - And I should see "Moodle Cloud" - And I should not see "This Database has offline data to be synchronised" - And I press "Information" in the app - And I press "Refresh" in the app - And I wait until the page is ready - And I switch offline mode to "true" - And I press "Delete" in the app - And I should see "Are you sure you want to delete this entry?" - And I press "OK" in the app - And I should see "https://moodlecloud.com/" - And I should see "Moodle Cloud" - And I should see "This Database has offline data to be synchronised" - And I press "back" near "Web links" in the app - And I switch offline mode to "false" - And I press "Web links" near "General" in the app - And I should not see "https://moodlecloud.com/" - And I should not see "Moodle Cloud" - And I should not see "This Database has offline data to be synchronised" - - @app_from3.7 - Scenario: Students can undo deleting entries to a database in the app while offline - Given I enter the app - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Web links" near "General" in the app - And I should see "No entries in database" - And I press "Add entries" in the app - And I set the field "URL" to "https://moodle.org/" in the app - And I set the field "Description" to "Moodle community site" in the app - And I press "Save" near "Web links" in the app - And I should see "https://moodle.org/" - And I should see "Moodle community site" - And I press "Information" in the app - And I press "Download" in the app - And I wait until the page is ready - When I switch offline mode to "true" - And I press "Delete" in the app - And I should see "Are you sure you want to delete this entry?" - And I press "OK" in the app - And I should see "https://moodle.org/" - And I should see "Moodle community site" - And I should see "This Database has offline data to be synchronised" - And I press "Restore" in the app - And I press "back" near "Web links" in the app - And I switch offline mode to "false" - And I press "Web links" near "General" in the app - Then I should see "https://moodle.org/" - And I should see "Moodle community site" - And I should not see "This Database has offline data to be synchronised" diff --git a/mod/quiz/tests/behat/app_quiz_navigation.feature b/mod/quiz/tests/behat/app_quiz_navigation.feature deleted file mode 100755 index 63c0e71be..000000000 --- a/mod/quiz/tests/behat/app_quiz_navigation.feature +++ /dev/null @@ -1,110 +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" - - @app_from3.7.1 - Scenario: Next and previous navigation in the 3.7 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 "Are you sure" - And I should see "OK" - And I press "OK" in the app - And I pause - And I should see "Acceptance test site" \ No newline at end of file From 72dae3cadf8271f2201cf686c3ee5980611e31a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Tue, 21 Jan 2020 11:30:36 +0100 Subject: [PATCH 14/61] MOBILE-3307 behat: Behat basic test for course --- .../tests/behat/app_basic_usage.feature | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100755 mod/course/tests/behat/app_basic_usage.feature diff --git a/mod/course/tests/behat/app_basic_usage.feature b/mod/course/tests/behat/app_basic_usage.feature new file mode 100755 index 000000000..30794447b --- /dev/null +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -0,0 +1,154 @@ +@mod @mod_course @app @javascript +Feature: Test basic usage of one course in app + In order to participate in one course while using the mobile app + As a student + I need basic courses functionality to work + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | teacher | teacher1@example.com | + | student1 | Student | student | student1@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 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | option | + | choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | + + And the following "activities" exist: + | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | + | assign | C1 | assign1 | assignment | Test assignment description | 1 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | assessed | scale[modgrade_type] | + | forum | Test forum name | Test forum | C1 | forum | 0 | 5 | Point | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | chat | Test chat name | Test chat | C1 | chat | 0 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | data | Web links | Useful links | C1 | data1 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | lti | Test external name | Test external | C1 | external | 0 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | feedback | Test feedback name | Test feedback | C1 | feedback | 0 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | glossary | Test glossary | glossary description | C1 | gloss1 | + + 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 | groupmode | + | survey | Test survey name | Test survey | C1 | survey | 0 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | wiki | Test wiki name | Test wiki | C1 | wiki | 0 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | lesson | Test lesson name | Test lesson | C1 | lesson | 0 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | scorm | Test scorm name | Test scorm | C1 | scorm | 0 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | workshop | Test workshop name | Test workshop | C1 | workshop | 0 | + + @app @3.8.0 @OK + Scenario: Student views course contents + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I should see "Choice course 1" + And I should see "assignment" + And I should see "Test forum name" + And I should see "Test chat name" + And I should see "Web links" + And I should see "Test external name" + And I should see "Test feedback name" + And I should see "Test glossary" + And I should see "Quiz 1" + And I should see "Test survey name" + And I should see "Test wiki name" + And I should see "Test lesson name" + And I should see "Test scorm name" + And I should see "Test workshop name" + And I press "Choice course 1" in the app + Then the header should be "Choice course 1" in the app + And I press the back button in the app + And I press "assignment" in the app + Then the header should be "assignment" in the app + And I press the back button in the app + And I press "Test forum name" in the app + Then the header should be "Test forum name" in the app + And I press the back button in the app + And I press "Test chat name" in the app + Then the header should be "Test chat name" in the app + And I press the back button in the app + And I press "Web links" in the app + Then the header should be "Web links" in the app + And I press the back button in the app + And I press "Test external name" in the app + Then the header should be "Test external name" in the app + And I press the back button in the app + And I press "Test feedback name" in the app + And I press "OK" in the app + Then the header should be "Test feedback name" in the app + And I press the back button in the app + And I press "Test glossary" in the app + Then the header should be "Test glossary" in the app + And I press the back button in the app + And I press "Quiz 1" in the app + Then the header should be "Quiz 1" in the app + And I press the back button in the app + And I press "Test survey name" in the app + Then the header should be "Test survey name" in the app + And I press the back button in the app + And I press "Test wiki name" in the app + And I press "OK" in the app + Then the header should be "Test wiki name" in the app + And I press the back button in the app + And I press "Test lesson name" in the app + Then the header should be "Test lesson name" in the app + And I press the back button in the app + And I press "Test scorm name" in the app + Then the header should be "Test scorm name" in the app + And I press the back button in the app + And I press "Test workshop name" in the app + Then the header should be "Test workshop name" in the app + And I press the back button in the app \ No newline at end of file From 57cc2e5b20f8740780ef54c53ee384726853cbb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 22 Jan 2020 09:42:59 +0100 Subject: [PATCH 15/61] MOBILE-3307 behat: Behat basic test for course --- .../tests/behat/app_basic_usage.feature | 213 ++++++++++++++++-- 1 file changed, 188 insertions(+), 25 deletions(-) diff --git a/mod/course/tests/behat/app_basic_usage.feature b/mod/course/tests/behat/app_basic_usage.feature index 30794447b..e6f0e517e 100755 --- a/mod/course/tests/behat/app_basic_usage.feature +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -20,45 +20,45 @@ Feature: Test basic usage of one course in app | student1 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | option | - | choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | + | activity | name | intro | course | idnumber | option | section | + | choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 1 | And the following "activities" exist: - | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | - | assign | C1 | assign1 | assignment | Test assignment description | 1 | + | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | section | + | assign | C1 | assign1 | assignment | Test assignment description | 1 | 1 | And the following "activities" exist: | activity | name | intro | course | idnumber | groupmode | assessed | scale[modgrade_type] | | forum | Test forum name | Test forum | C1 | forum | 0 | 5 | Point | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | chat | Test chat name | Test chat | C1 | chat | 0 | + | activity | name | intro | course | idnumber | groupmode | section | + | chat | Test chat name | Test chat | C1 | chat | 0 | 2 | And the following "activities" exist: - | activity | name | intro | course | idnumber | - | data | Web links | Useful links | C1 | data1 | + | activity | name | intro | course | idnumber | section | + | data | Web links | Useful links | C1 | data1 | 4 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | lti | Test external name | Test external | C1 | external | 0 | + | activity | name | intro | course | idnumber | groupmode | section | + | lti | Test external name | Test external | C1 | external | 0 | 1 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | feedback | Test feedback name | Test feedback | C1 | feedback | 0 | + | activity | name | intro | course | idnumber | groupmode | section | + | feedback | Test feedback name | Test feedback | C1 | feedback | 0 | 3 | And the following "activities" exist: - | activity | name | intro | course | idnumber | - | glossary | Test glossary | glossary description | C1 | gloss1 | + | activity | name | intro | course | idnumber | section | + | glossary | Test glossary | glossary description | C1 | gloss1 | 5 | And the following "activities" exist: - | activity | name | intro | course | idnumber | - | quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | + | activity | name | intro | course | idnumber | section | + | quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 2 | And the following "question categories" exist: | contextlevel | reference | name | | Course | C1 | Test questions | And the following "questions" exist: - | questioncategory | qtype | name | questiontext | + | 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: @@ -67,24 +67,24 @@ Feature: Test basic usage of one course in app | TF2 | 2 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | survey | Test survey name | Test survey | C1 | survey | 0 | + | activity | name | intro | course | idnumber | groupmode | section | + | survey | Test survey name | Test survey | C1 | survey | 0 | 1 | And the following "activities" exist: | activity | name | intro | course | idnumber | groupmode | | wiki | Test wiki name | Test wiki | C1 | wiki | 0 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | lesson | Test lesson name | Test lesson | C1 | lesson | 0 | + | activity | name | intro | course | idnumber | groupmode | section | + | lesson | Test lesson name | Test lesson | C1 | lesson | 0 | 3 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | scorm | Test scorm name | Test scorm | C1 | scorm | 0 | + | activity | name | intro | course | idnumber | groupmode | section | + | scorm | Test scorm name | Test scorm | C1 | scorm | 0 | 2 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | workshop | Test workshop name | Test workshop | C1 | workshop | 0 | + | activity | name | intro | course | idnumber | groupmode | section | + | workshop | Test workshop name | Test workshop | C1 | workshop | 0 | 3 | @app @3.8.0 @OK Scenario: Student views course contents @@ -151,4 +151,167 @@ Feature: Test basic usage of one course in app And I press the back button in the app And I press "Test workshop name" in the app Then the header should be "Test workshop name" in the app + And I press the back button in the app + + @app @3.8.0 @OK + Scenario: Student views section contents + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I should see "Choice course 1" + And I should see "assignment" + And I should see "Test forum name" + And I should see "Test chat name" + And I should see "Web links" + And I should see "Test external name" + And I should see "Test feedback name" + And I should see "Test glossary" + And I should see "Quiz 1" + And I should see "Test survey name" + And I should see "Test wiki name" + And I should see "Test lesson name" + And I should see "Test scorm name" + And I should see "Test workshop name" + And I press "arrow dropdown" in the app + And I press "General" near "Sections" in the app + Then I should not see "Choice course 1" + And I should not see "assignment" + And I should see "Test forum name" + And I should not see "Test chat name" + And I should not see "Web links" + And I should not see "Test external name" + And I should not see "Test feedback name" + And I should not see "Test glossary" + And I should not see "Quiz 1" + And I should not see "Test survey name" + And I should see "Test wiki name" + And I should not see "Test lesson name" + And I should not see "Test scorm name" + And I should not see "Test workshop name" + And I press "Test forum name" in the app + Then the header should be "Test forum name" in the app + And I press the back button in the app + And I press "Test wiki name" in the app + And I press "OK" in the app + Then the header should be "Test wiki name" in the app + And I press the back button in the app + And I press "arrow dropdown" in the app + And I press "Topic 1" near "Sections" in the app + Then I should see "Choice course 1" + And I should see "assignment" + And I should not see "Test forum name" + And I should not see "Test chat name" + And I should not see "Web links" + And I should see "Test external name" + And I should not see "Test feedback name" + And I should not see "Test glossary" + And I should not see "Quiz 1" + And I should see "Test survey name" + And I should not see "Test wiki name" + And I should not see "Test lesson name" + And I should not see "Test scorm name" + And I should not see "Test workshop name" + And I press "Choice course 1" in the app + Then the header should be "Choice course 1" in the app + And I press the back button in the app + And I press "assignment" in the app + Then the header should be "assignment" in the app + And I press the back button in the app + And I press "Test external name" in the app + Then the header should be "Test external name" in the app + And I press the back button in the app + And I press "Test survey name" in the app + Then the header should be "Test survey name" in the app + And I press the back button in the app + And I press "arrow dropdown" in the app + And I press "Topic 2" near "Sections" in the app + Then I should not see "Choice course 1" + And I should not see "assignment" + And I should not see "Test forum name" + And I should see "Test chat name" + And I should not see "Web links" + And I should not see "Test external name" + And I should not see "Test feedback name" + And I should not see "Test glossary" + And I should see "Quiz 1" + And I should not see "Test survey name" + And I should not see "Test wiki name" + And I should not see "Test lesson name" + And I should see "Test scorm name" + And I should not see "Test workshop name" + And I press "Test chat name" in the app + Then the header should be "Test chat name" in the app + And I press the back button in the app + And I press "Quiz 1" in the app + Then the header should be "Quiz 1" in the app + And I press the back button in the app + And I press "Test scorm name" in the app + Then the header should be "Test scorm name" in the app + And I press the back button in the app + And I press "arrow dropdown" in the app + And I press "Topic 3" near "Sections" in the app + Then I should not see "Choice course 1" + And I should not see "assignment" + And I should not see "Test forum name" + And I should not see "Test chat name" + And I should not see "Web links" + And I should not see "Test external name" + And I should see "Test feedback name" + And I should not see "Test glossary" + And I should not see "Quiz 1" + And I should not see "Test survey name" + And I should not see "Test wiki name" + And I should see "Test lesson name" + And I should not see "Test scorm name" + And I should see "Test workshop name" + And I press "Test feedback name" in the app + And I press "OK" in the app + Then the header should be "Test feedback name" in the app + And I press the back button in the app + And I press "Test lesson name" in the app + Then the header should be "Test lesson name" in the app + And I press the back button in the app + And I press "Test workshop name" in the app + Then the header should be "Test workshop name" in the app + And I press the back button in the app + And I press "arrow dropdown" in the app + And I press "Topic 4" near "Sections" in the app + Then I should not see "Choice course 1" + And I should not see "assignment" + And I should not see "Test forum name" + And I should not see "Test chat name" + And I should see "Web links" + And I should not see "Test external name" + And I should not see "Test feedback name" + And I should not see "Test glossary" + And I should not see "Quiz 1" + And I should not see "Test survey name" + And I should not see "Test wiki name" + And I should not see "Test lesson name" + And I should not see "Test scorm name" + And I should not see "Test workshop name" + And I press "Web links" in the app + Then the header should be "Web links" in the app + And I press the back button in the app + And I press "arrow dropdown" in the app + And I press "Topic 5" near "Sections" in the app + Then I should not see "Choice course 1" + And I should not see "assignment" + And I should not see "Test forum name" + And I should not see "Test chat name" + And I should not see "Web links" + And I should not see "Test external name" + And I should not see "Test feedback name" + And I should see "Test glossary" + And I should not see "Quiz 1" + And I should not see "Test survey name" + And I should not see "Test wiki name" + And I should not see "Test lesson name" + And I should not see "Test scorm name" + And I should not see "Test workshop name" + And I press "Test glossary" in the app + Then the header should be "Test glossary" in the app And I press the back button in the app \ No newline at end of file From 3cf915376ba48a83b1686c41def143696f2726cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 22 Jan 2020 10:48:15 +0100 Subject: [PATCH 16/61] MOBILE-3307 behat: Behat basic test for course --- .../tests/behat/app_basic_usage.feature | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/mod/course/tests/behat/app_basic_usage.feature b/mod/course/tests/behat/app_basic_usage.feature index e6f0e517e..b4d453a42 100755 --- a/mod/course/tests/behat/app_basic_usage.feature +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -314,4 +314,77 @@ Feature: Test basic usage of one course in app And I should not see "Test workshop name" And I press "Test glossary" in the app Then the header should be "Test glossary" in the app - And I press the back button in the app \ No newline at end of file + And I press the back button in the app + + @app @3.8.0 @OK + Scenario: Navigation between sections using the bottom arrows + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I should see "Choice course 1" + And I should see "assignment" + And I should see "Test forum name" + And I should see "Test chat name" + And I should see "Web links" + And I should see "Test external name" + And I should see "Test feedback name" + And I should see "Test glossary" + And I should see "Quiz 1" + And I should see "Test survey name" + And I should see "Test wiki name" + And I should see "Test lesson name" + And I should see "Test scorm name" + And I should see "Test workshop name" + And I press "arrow dropdown" in the app + And I press "General" near "Sections" in the app + Then I should see "General" + And I should not see "Topic 1" + And I should not see "Topic 2" + And I should not see "Topic 3" + And I should not see "Topic 4" + And I should not see "Topic 5" + And I press "arrow forward" near "Test wiki name" in the app + Then I should not see "General" + And I should see "Topic 1" + And I should not see "Topic 2" + And I should not see "Topic 3" + And I should not see "Topic 4" + And I should not see "Topic 5" + And I press "arrow forward" near "Test survey name" in the app + Then I should not see "General" + And I should not see "Topic 1" + And I should see "Topic 2" + And I should not see "Topic 3" + And I should not see "Topic 4" + And I should not see "Topic 5" + And I press "arrow forward" near "Test scorm name" in the app + Then I should not see "General" + And I should not see "Topic 1" + And I should not see "Topic 2" + And I should see "Topic 3" + And I should not see "Topic 4" + And I should not see "Topic 5" + And I press "arrow forward" near "Test workshop name" in the app + Then I should not see "General" + And I should not see "Topic 1" + And I should not see "Topic 2" + And I should not see "Topic 3" + And I should see "Topic 4" + And I should not see "Topic 5" + And I press "arrow forward" near "Web links" in the app + Then I should not see "General" + And I should not see "Topic 1" + And I should not see "Topic 2" + And I should not see "Topic 3" + And I should not see "Topic 4" + And I should see "Topic 5" + And I press "arrow back" near "Test glossary" in the app + Then I should not see "General" + And I should not see "Topic 1" + And I should not see "Topic 2" + And I should not see "Topic 3" + And I should see "Topic 4" + And I should not see "Topic 5" \ No newline at end of file From 8db0829bd3b128a09b1887e3054e11e79ffd9c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 23 Jan 2020 09:49:05 +0100 Subject: [PATCH 17/61] MOBILE-3307 behat: Behat basic test for course --- .../tests/behat/app_basic_usage.feature | 50 ++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/mod/course/tests/behat/app_basic_usage.feature b/mod/course/tests/behat/app_basic_usage.feature index b4d453a42..98af9e0fa 100755 --- a/mod/course/tests/behat/app_basic_usage.feature +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -9,6 +9,7 @@ Feature: Test basic usage of one course in app | username | firstname | lastname | email | | teacher1 | Teacher | teacher | teacher1@example.com | | student1 | Student | student | student1@example.com | + | student2 | Student2 | student2 | student2@example.com | And the following "courses" exist: | fullname | shortname | category | @@ -315,7 +316,7 @@ Feature: Test basic usage of one course in app And I press "Test glossary" in the app Then the header should be "Test glossary" in the app And I press the back button in the app - + @app @3.8.0 @OK Scenario: Navigation between sections using the bottom arrows When I enter the app @@ -387,4 +388,49 @@ Feature: Test basic usage of one course in app And I should not see "Topic 2" And I should not see "Topic 3" And I should see "Topic 4" - And I should not see "Topic 5" \ No newline at end of file + And I should not see "Topic 5" + + @app @3.8.0 @OK + Scenario: Self enrol + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Information" in the app + And I press "Course summary" 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 "More..." + And I follow "Users" + And I follow "Enrolment methods" + And I follow "Delete" + And I press "Continue" + And I follow "Enable" + And I close the browser tab opened by the app + When I enter the app + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I press "Site home" in the app + And I press "Available courses" in the app + And I press "Course 1" in the app + And I press "Enrol me" in the app + And I press "OK" in the app + And I press "Contents" in the app + Then the header should be "Course 1" in the app + And I should see "Choice course 1" + And I should see "assignment" + And I should see "Test forum name" + And I should see "Test chat name" + And I should see "Web links" + And I should see "Test external name" + And I should see "Test feedback name" + And I should see "Test glossary" + And I should see "Quiz 1" + And I should see "Test survey name" + And I should see "Test wiki name" + And I should see "Test lesson name" + And I should see "Test scorm name" + And I should see "Test workshop name" \ No newline at end of file From b263552d9cb8772e266682883e93750db9940b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 23 Jan 2020 10:27:26 +0100 Subject: [PATCH 18/61] MOBILE-3307 behat: Behat basic test for course --- .../tests/behat/app_basic_usage.feature | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/mod/course/tests/behat/app_basic_usage.feature b/mod/course/tests/behat/app_basic_usage.feature index 98af9e0fa..7a8401683 100755 --- a/mod/course/tests/behat/app_basic_usage.feature +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -433,4 +433,46 @@ Feature: Test basic usage of one course in app And I should see "Test wiki name" And I should see "Test lesson name" And I should see "Test scorm name" + And I should see "Test workshop name" + + @app @3.8.0 @OK + Scenario: Guest access + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Information" in the app + And I press "Course summary" 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 "More..." + And I follow "Users" + And I follow "Enrolment methods" + And I follow "Enable" + And I close the browser tab opened by the app + When I enter the app + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I press "Site home" in the app + And I press "Available courses" in the app + And I press "Course 1" in the app + Then I should see "Download course" + And I should see "Contents" + And I press "Contents" in the app + Then the header should be "Course 1" in the app + And I should see "Choice course 1" + And I should see "assignment" + And I should see "Test forum name" + And I should see "Test chat name" + And I should see "Web links" + And I should see "Test feedback name" + And I should see "Test glossary" + And I should see "Quiz 1" + And I should see "Test survey name" + And I should see "Test wiki name" + And I should see "Test lesson name" + And I should see "Test scorm name" And I should see "Test workshop name" \ No newline at end of file From ab223d6a0a9847c495f03d9bea58cbcd88b73f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 23 Jan 2020 12:43:10 +0100 Subject: [PATCH 19/61] MOBILE-3307 behat: Behat basic test for course --- .../tests/behat/app_basic_usage.feature | 102 +++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/mod/course/tests/behat/app_basic_usage.feature b/mod/course/tests/behat/app_basic_usage.feature index 7a8401683..66f79b1a7 100755 --- a/mod/course/tests/behat/app_basic_usage.feature +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -475,4 +475,104 @@ Feature: Test basic usage of one course in app And I should see "Test wiki name" And I should see "Test lesson name" And I should see "Test scorm name" - And I should see "Test workshop name" \ No newline at end of file + And I should see "Test workshop name" + + @app @3.8.0 @mobile @OK + Scenario: View blocks bellow/beside contents also when All sections selected (mobile) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Information" in the app + And I press "Course summary" 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 "Turn editing on" + And I click on "Side panel" "button" + And I follow "Add a block" + And I follow "HTML" + And I click on "Side panel" "button" + And I follow "Add a block" + And I follow "Activities" + And I click on "Actions menu" "icon" in the "#dropdown-0" "css_element" + And I follow "Configure (new HTML block) block" + And I set the field "HTML block title" to "HTML title test" + And I set the field "Content" to "body test" + And I press "Save changes" + And I close the browser tab opened by the app + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I should see "Choice course 1" + And I should see "assignment" + And I should see "Test forum name" + And I should see "Test chat name" + And I should see "Web links" + And I should see "Test external name" + And I should see "Test feedback name" + And I should see "Test glossary" + And I should see "Quiz 1" + And I should see "Test survey name" + And I should see "Test wiki name" + And I should see "Test lesson name" + And I should see "Test scorm name" + And I should see "Test workshop name" + Then I should see "HTML title test" + And I should see "body test" + And I should see "Activities" + + @app @3.8.0 @tablet @OK + Scenario: View blocks bellow/beside contents also when All sections selected (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Information" in the app + And I press "Course summary" 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 "Turn editing on" + And I follow "Add a block" + And I follow "HTML" + And I follow "Add a block" + And I follow "Activities" + And I click on "Actions menu" "icon" in the "#dropdown-0" "css_element" + And I follow "Configure (new HTML block) block" + And I set the field "HTML block title" to "HTML title test" + And I set the field "Content" to "body test" + And I press "Save changes" + And I close the browser tab opened by the app + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I should see "Choice course 1" + And I should see "assignment" + And I should see "Test forum name" + And I should see "Test chat name" + And I should see "Web links" + And I should see "Test external name" + And I should see "Test feedback name" + And I should see "Test glossary" + And I should see "Quiz 1" + And I should see "Test survey name" + And I should see "Test wiki name" + And I should see "Test lesson name" + And I should see "Test scorm name" + And I should see "Test workshop name" + Then I should see "HTML title test" + And I should see "body test" + And I should see "Activities" \ No newline at end of file From 57f52a8c6000849694b710c437842f13046d25e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Fri, 24 Jan 2020 12:00:17 +0100 Subject: [PATCH 20/61] MOBILE-3307 MOBILE-3319 behat: Behat basic test for messages and an improvement on course --- .../tests/behat/app_basic_usage.feature | 10 +- .../tests/behat/app_basic_usage.feature | 95 +++++++++++++++++++ 2 files changed, 99 insertions(+), 6 deletions(-) create mode 100755 mod/messages/tests/behat/app_basic_usage.feature diff --git a/mod/course/tests/behat/app_basic_usage.feature b/mod/course/tests/behat/app_basic_usage.feature index 66f79b1a7..7452476e0 100755 --- a/mod/course/tests/behat/app_basic_usage.feature +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -2,7 +2,7 @@ Feature: Test basic usage of one course in app In order to participate in one course while using the mobile app As a student - I need basic courses functionality to work + I need basic course functionality to work Background: Given the following "users" exist: @@ -406,9 +406,7 @@ Feature: Test basic usage of one course in app And I follow "More..." And I follow "Users" And I follow "Enrolment methods" - And I follow "Delete" - And I press "Continue" - And I follow "Enable" + And I click on "Enable" "icon" in the "Self enrolment (Student)" "table_row" And I close the browser tab opened by the app When I enter the app And I log in as "student2" @@ -434,7 +432,7 @@ Feature: Test basic usage of one course in app And I should see "Test lesson name" And I should see "Test scorm name" And I should see "Test workshop name" - + @app @3.8.0 @OK Scenario: Guest access When I enter the app @@ -451,7 +449,7 @@ Feature: Test basic usage of one course in app And I follow "More..." And I follow "Users" And I follow "Enrolment methods" - And I follow "Enable" + And I click on "Enable" "icon" in the "Guest access" "table_row" And I close the browser tab opened by the app When I enter the app And I log in as "student2" diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature new file mode 100755 index 000000000..142f4dd63 --- /dev/null +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -0,0 +1,95 @@ +@mod @mod_messages @app @javascript +Feature: Test basic usage of messages in app + In order to participate with messages while using the mobile app + As a student + I need basic messages functionality to work + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | teacher | teacher1@example.com | + | student1 | Student1 | student1 | student1@example.com | + | student2 | Student2 | student2 | student2@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 | + + + @app @3.8.0 @mobile @OK + Scenario: View recent conversations and contacts (mobile) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + Then I should see "No contacts" + And I press "addon.messages.search" in the app + And I set the field "Search" to "student" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "heeey student" in the app + And I press "Send" in the app + And I press "Conversation actions menu" in the app + And I press "Add to contacts" in the app + And I press "Add" in the app + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + And I press "Requests" in the app + And I press "Teacher teacher" in the app + And I press "Accept and add to contacts" in the app + And I press the back button in the app + And I press "Contacts" near "Requests" in the app + Then the header should be "Contacts" in the app + And I should see "Teacher teacher" + And I press the back button in the app + And I press "Teacher teacher" in the app + Then the header should be "Teacher teacher" in the app + And I should see "heeey student" + + @app @3.8.0 @tablet @OK + Scenario: View recent conversations and contacts (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + Then I should see "No contacts" + And I press "addon.messages.search" in the app + And I set the field "Search" to "student" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "heeey student" in the app + And I press "Send" in the app + And I press "Information" in the app + And I press "Add to contacts" in the app + And I press "Add" in the app + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + And I press "Requests" in the app + And I press "Teacher teacher" in the app + And I press "Accept and add to contacts" in the app + And I press "Contacts" near "Requests" in the app + Then the header should be "Contacts" in the app + And I should see "Teacher teacher" + And I press the back button in the app + And I press "Teacher teacher" in the app + And I should see "heeey student" \ No newline at end of file From 5b007b0125abd298d70e1f567ee9907d6ba1c3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Fri, 24 Jan 2020 12:17:36 +0100 Subject: [PATCH 21/61] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index 142f4dd63..e03fe7502 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -92,4 +92,19 @@ Feature: Test basic usage of messages in app And I should see "Teacher teacher" And I press the back button in the app And I press "Teacher teacher" in the app - And I should see "heeey student" \ No newline at end of file + And I should see "heeey student" + + @app @3.8.0 @OK + Scenario: Search users + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "addon.messages.search" in the app + And I set the field "Search" to "student2" in the app + And I press "search" in the app + Then I should see "Student2 student2" + And I set the field "Search" to "Teacher" in the app + And I press "search" in the app + Then I should see "Teacher teacher" \ No newline at end of file From f30e176a13504e47a68ad5f8a8ad2022f3967c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 27 Jan 2020 09:15:14 +0100 Subject: [PATCH 22/61] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index e03fe7502..54cc8ea20 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -86,7 +86,7 @@ Feature: Test basic usage of messages in app And I press "Contacts" in the app And I press "Requests" in the app And I press "Teacher teacher" in the app - And I press "Accept and add to contacts" in the app + And I press "Accept and add to contacts" in the appa And I press "Contacts" near "Requests" in the app Then the header should be "Contacts" in the app And I should see "Teacher teacher" @@ -107,4 +107,52 @@ Feature: Test basic usage of messages in app Then I should see "Student2 student2" And I set the field "Search" to "Teacher" in the app And I press "search" in the app - Then I should see "Teacher teacher" \ No newline at end of file + Then I should see "Teacher teacher" + + @app @3.8.0 @OK + Scenario: Send/receive messages in existing conversations + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + Then I should see "No contacts" + And I press "addon.messages.search" in the app + And I set the field "Search" to "student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "heeey student" in the app + And I press "Send" in the app + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + Then I should see "No contacts" + And I press "addon.messages.search" in the app + And I set the field "Search" to "teacher" in the app + And I press "search" in the app + And I press "Teacher teacher" in the app + Then I should see "heeey student" + And I set the field "New message" to "hi" in the app + And I press "Send" in the app + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + Then I should see "No contacts" + And I press "addon.messages.search" in the app + And I set the field "Search" to "student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + Then I should see "heeey student" + And I should see "hi" + And I set the field "New message" to "byee" in the app + And I press "Send" in the app + Then I should see "heeey student" + And I should see "hi" + And I should see "byee" \ No newline at end of file From c4c665badcb34f733160d0f09291e87b17087c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 27 Jan 2020 09:17:55 +0100 Subject: [PATCH 23/61] MOBILE-3319 behat: Behat basic test for messages --- mod/messages/tests/behat/app_basic_usage.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index 54cc8ea20..f7b446a8a 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -86,7 +86,7 @@ Feature: Test basic usage of messages in app And I press "Contacts" in the app And I press "Requests" in the app And I press "Teacher teacher" in the app - And I press "Accept and add to contacts" in the appa + And I press "Accept and add to contacts" in the app And I press "Contacts" near "Requests" in the app Then the header should be "Contacts" in the app And I should see "Teacher teacher" From 529206bbaf7218cce123c57aea34f4ef4647732e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 27 Jan 2020 10:39:37 +0100 Subject: [PATCH 24/61] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 96 ++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index f7b446a8a..8c94bc1cb 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -155,4 +155,98 @@ Feature: Test basic usage of messages in app And I press "Send" in the app Then I should see "heeey student" And I should see "hi" - And I should see "byee" \ No newline at end of file + And I should see "byee" + + @app @3.8.0 @OK + Scenario: User profile, send message, add/remove contact (mobile) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + Then I should see "No contacts" + And I press "addon.messages.search" in the app + And I set the field "Search" to "student" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "heeey student" in the app + And I press "Send" in the app + And I press "Conversation actions menu" in the app + And I press "Add to contacts" in the app + And I press "Add" in the app + Then I should see "Contact request sent" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + And I press "Requests" in the app + And I press "Teacher teacher" in the app + Then I should see "Teacher teacher would like to contact you" + And I press "Accept and add to contacts" in the app + And I should not see "Teacher teacher would like to contact you" + And I press "Teacher teacher" in the app + And I press "Message" in the app + And I set the field "New message" to "hi" in the app + And I press "Send" in the app + Then I should see "heeey student" + And I should see "hi" + And I press the back button in the app + And I press "Remove from contacts" in the app + And I press "Remove" in the app + Then I should see "Add to contacts" + And I press the back button in the app + And I press "Conversation actions menu" in the app + Then I should see "Add to contacts" + And I press "Delete conversation" in the app + And I press "Delete" in the app + And I should not see "heeey student" + And I should not see "hi" + + @app @3.8.0 @OK + Scenario: User profile, send message, add/remove contact (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + Then I should see "No contacts" + And I press "addon.messages.search" in the app + And I set the field "Search" to "student" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "heeey student" in the app + And I press "Send" in the app + And I press "Information" in the app + And I press "Add to contacts" in the app + And I press "Add" in the app + Then I should see "Contact request sent" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + And I press "Requests" in the app + And I press "Teacher teacher" in the app + Then I should see "Teacher teacher would like to contact you" + And I press "Accept and add to contacts" in the app + And I should not see "Teacher teacher would like to contact you" + And I set the field "New message" to "hi" in the app + And I press "Send" in the app + Then I should see "heeey student" + And I should see "hi" + And I press "Information" in the app + And I press "Remove from contacts" in the app + And I press "Remove" in the app + And I press "Information" in the app + Then I should see "Add to contacts" + And I press "Delete conversation" in the app + And I press "Delete" in the app + And I should not see "heeey student" + And I should not see "hi" \ No newline at end of file From 84e9f6ce6f27a24394e8bd500f1437fe12a783a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 27 Jan 2020 12:05:36 +0100 Subject: [PATCH 25/61] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 67 ++++++++++++++++++- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index 8c94bc1cb..9d373037d 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -157,7 +157,7 @@ Feature: Test basic usage of messages in app And I should see "hi" And I should see "byee" - @app @3.8.0 @OK + @app @3.8.0 @mobile @OK Scenario: User profile, send message, add/remove contact (mobile) When I enter the app And I log in as "teacher1" @@ -205,7 +205,7 @@ Feature: Test basic usage of messages in app And I should not see "heeey student" And I should not see "hi" - @app @3.8.0 @OK + @app @3.8.0 @tablet @OK Scenario: User profile, send message, add/remove contact (tablet) When I enter the app And I change viewport size to "1280x1080" @@ -249,4 +249,65 @@ Feature: Test basic usage of messages in app And I press "Delete conversation" in the app And I press "Delete" in the app And I should not see "heeey student" - And I should not see "hi" \ No newline at end of file + And I should not see "hi" + + @app @3.8.0 @mobile @OK + Scenario: Send message offline (mobile) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + Then I should see "No contacts" + And I press "addon.messages.search" in the app + And I set the field "Search" to "student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I switch offline mode to "true" + And I set the field "New message" to "heeey student" in the app + And I press "Send" in the app + And I set the field "New message" to "byee" in the app + And I press "Send" in the app + And I switch offline mode to "false" + And I press the back button in the app + And I press "Student1 student1" in the app + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Teacher teacher" in the app + Then I should see "heeey student" + And I should see "byee" + + @app @3.8.0 @tablet @OK + Scenario: Send message offline (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + Then I should see "No contacts" + And I press "addon.messages.search" in the app + And I set the field "Search" to "student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I switch offline mode to "true" + And I set the field "New message" to "heeey student" in the app + And I press "Send" in the app + And I set the field "New message" to "byee" in the app + And I press "Send" in the app + And I switch offline mode to "false" + And I press "Student1 student1" in the app + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Teacher teacher" in the app + Then I should see "heeey student" + And I should see "byee" \ No newline at end of file From 9e052a56222d47cea6d28c8205b0bbb91320b21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Tue, 28 Jan 2020 09:44:15 +0100 Subject: [PATCH 26/61] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index 9d373037d..666938df7 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -2,7 +2,7 @@ Feature: Test basic usage of messages in app In order to participate with messages while using the mobile app As a student - I need basic messages functionality to work + I need basic message functionality to work Background: Given the following "users" exist: @@ -310,4 +310,33 @@ Feature: Test basic usage of messages in app And I press "Messages" in the app And I press "Teacher teacher" in the app Then I should see "heeey student" - And I should see "byee" \ No newline at end of file + And I should see "byee" + + @app @3.8.0 @OK + Scenario: Search for messages + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "addon.messages.search" in the app + And I set the field "Search" to "student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "test message" in the app + And I press "Send" in the app + And I set the field "New message" to "search this message" in the app + And I press "Send" in the app + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "addon.messages.search" in the app + And I set the field "Search" to "search this message" in the app + And I press "search" in the app + Then I should see "Messages" + And I should see "search this message" + And I press "search this message" near "Teacher teacher" in the app + Then I should see "test message" + And I should see "search this message" \ No newline at end of file From 05a92a6088ac841aedfb38fa9e2f7305398d7089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Tue, 28 Jan 2020 10:43:11 +0100 Subject: [PATCH 27/61] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 86 ++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index 666938df7..6c3744ac4 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -339,4 +339,88 @@ Feature: Test basic usage of messages in app And I should see "search this message" And I press "search this message" near "Teacher teacher" in the app Then I should see "test message" - And I should see "search this message" \ No newline at end of file + And I should see "search this message" + + @app @3.8.0 @mobile @OK + Scenario: Star/Unstar (mobile) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "addon.messages.search" in the app + And I set the field "Search" to "student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "star message" in the app + And I press "Send" in the app + When I enter the app + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "addon.messages.search" in the app + And I set the field "Search" to "student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "test message student2" in the app + And I press "Send" in the app + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + Then I should see "Private (2)" + And I should see "Starred (1)" + And I press "star message" in the app + And I press "Conversation actions menu" in the app + And I press "Star conversation" in the app + And I press the back button in the app + Then I should see "Private (1)" + And I should see "Starred (2)" + And I press "Starred (2)" in the app + Then I should see "Teacher teacher" + And I should see "Student1 student1" + + @app @3.8.0 @tablet @OK + Scenario: Star/Unstar (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "addon.messages.search" in the app + And I set the field "Search" to "student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "star message" in the app + And I press "Send" in the app + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "addon.messages.search" in the app + And I set the field "Search" to "student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "test message student2" in the app + And I press "Send" in the app + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + Then I should see "Private (2)" + And I should see "Starred (1)" + And I press "star message" in the app + And I press "Information" in the app + And I press "Star conversation" in the app + Then I should see "Private (1)" + And I should see "Starred (2)" + And I press "Starred (2)" in the app + Then I should see "Teacher teacher" + And I should see "Student1 student1" \ No newline at end of file From b30f8ab4d1c3e4813da06ced5ba87e7a2004352a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Tue, 28 Jan 2020 12:01:42 +0100 Subject: [PATCH 28/61] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 118 +++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index 6c3744ac4..f4948ce71 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -423,4 +423,120 @@ Feature: Test basic usage of messages in app And I should see "Starred (2)" And I press "Starred (2)" in the app Then I should see "Teacher teacher" - And I should see "Student1 student1" \ No newline at end of file + And I should see "Student1 student1" + + @app @3.8.0 @mobile @OK + Scenario: User blocking feature (mobile) + When I enter the app + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student1 student1" in the app + Then I should see "Block user" + And I press "Block user" in the app + And I should see "Are you sure you want to block Student1 student1?" + And I press "Cancel" in the app + And I should see "Block user" + And I press "Block user" in the app + And I press "Block user" near "Cancel" in the app + Then I should not see "Block user" + And I should see "Unblock user" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student2 student2" in the app + And I press "Message" in the app + Then I should see "You are unable to message this user" + When I enter the app + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student1 student1" in the app + Then I should see "Unblock user" + And I should not see "Block user" + And I press "Unblock user" in the app + And I press "Cancel" in the app + Then I should see "Unblock user" + And I should not see "Block user" + And I press "Unblock user" in the app + And I press "Unblock user" near "Cancel" in the app + Then I should see "Block user" + And I should not see "Unblock user" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student2 student2" in the app + And I press "Message" in the app + And I set the field "New message" to "test message" in the app + And I press "Send" in the app + Then I should see "test message" + And I should not see "You are unable to message this user" + + @app @3.8.0 @tablet @OK + Scenario: User blocking feature (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + Then I should see "Block user" + And I press "Block user" in the app + And I should see "Are you sure you want to block Student1 student1?" + And I press "Cancel" in the app + And I should see "Block user" + And I press "Block user" in the app + And I press "Block user" near "Cancel" in the app + Then I should not see "Block user" + And I should see "Unblock user" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student2 student2" in the app + And I press "Message" in the app + Then I should see "You are unable to message this user" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + Then I should see "Unblock user" + And I should not see "Block user" + And I press "Unblock user" in the app + And I press "Cancel" in the app + Then I should see "Unblock user" + And I should not see "Block user" + And I press "Unblock user" in the app + And I press "Unblock user" near "Cancel" in the app + Then I should see "Block user" + And I should not see "Unblock user" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student2 student2" in the app + And I press "Message" in the app + And I set the field "New message" to "test message" in the app + And I press "Send" in the app + Then I should see "test message" + And I should not see "You are unable to message this user" \ No newline at end of file From 18282d8045cbd4e00ca14354c039094bcc7d6f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 29 Jan 2020 09:21:59 +0100 Subject: [PATCH 29/61] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index f4948ce71..c6d6b15c2 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -539,4 +539,65 @@ Feature: Test basic usage of messages in app And I set the field "New message" to "test message" in the app And I press "Send" in the app Then I should see "test message" - And I should not see "You are unable to message this user" \ No newline at end of file + And I should not see "You are unable to message this user" + + @app @3.8.0 @mobile @OK + Scenario: Mute Unmute conversations (mobile) + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student2 student2" in the app + And I press "Message" in the app + And I set the field "New message" to "test message" in the app + And I press "Send" in the app + And I press "Conversation actions menu" in the app + And I press "Mute" in the app + And I press "Muted conversation" in the app + And I press "Conversation actions menu" in the app + Then I should see "Unmute" + And I should not see "Mute" + And I press "Unmute" in the app + And I press "Conversation actions menu" in the app + Then I should not see "Unmute" + And I should see "Mute" + And I press "Mute" in the app + And I press "Messages" in the app + And I press "Private (1)" in the app + And I press "Student2 student2" in the app + And I press "Conversation actions menu" in the app + Then I should see "Unmute" + And I should not see "Mute" + + @app @3.8.0 @tablet @OK + Scenario: Mute Unmute conversations (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student2 student2" in the app + And I press "Message" in the app + And I set the field "New message" to "test message" in the app + And I press "Send" in the app + And I press "Conversation actions menu" in the app + And I press "Mute" in the app + And I press "Muted conversation" in the app + And I press "Conversation actions menu" in the app + Then I should see "Unmute" + And I should not see "Mute" + And I press "Unmute" in the app + And I press "Conversation actions menu" in the app + Then I should not see "Unmute" + And I should see "Mute" + And I press "Mute" in the app + And I press "Messages" in the app + And I press "Private (1)" in the app + And I press "Student2 student2" in the app + And I press "Information" in the app + Then I should see "Unmute" + And I should not see "Mute" \ No newline at end of file From f5eb3a63a2c47738f0da7cfdc26a6cff06966930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 29 Jan 2020 10:20:46 +0100 Subject: [PATCH 30/61] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 102 +++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index c6d6b15c2..89696f64f 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -600,4 +600,104 @@ Feature: Test basic usage of messages in app And I press "Student2 student2" in the app And I press "Information" in the app Then I should see "Unmute" - And I should not see "Mute" \ No newline at end of file + And I should not see "Mute" + + @app @3.8.0 @mobile @OK + Scenario: Self conversations (mobile) + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + Then I should see "Starred (1)" + And I press "Student1 student1" in the app + And I set the field "New message" to "self conversation" in the app + And I press "Send" in the app + And I switch offline mode to "true" + And I set the field "New message" to "self conversation offline" in the app + And I press "Send" in the app + And I switch offline mode to "false" + And I press the back button in the app + And I press "Student1 student1" in the app + And I press "Conversation actions menu" in the app + Then I should see "Unstar conversation" + And I should see "Show delete messages" + And I should see "Delete conversation" + And I press "Unstar conversation" in the app + And I press "Conversation actions menu" in the app + Then I should see "Star conversation" + And I should see "Show delete messages" + And I should see "Delete conversation" + And I press "Show delete messages" in the app + And I should see "self conversation" + And I should see "self conversation offline" + And I press "Delete message" near "self conversation offline" in the app + And I press "OK" in the app + Then I should see "self conversation" + And I should not see "self conversation offline" + And I press "Conversation actions menu" in the app + And I press "Delete conversation" in the app + And I press "Delete" in the app + Then I should not see "self conversation" + And I should not see "self conversation offline" + And I press the back button in the app + And I press "addon.messages.search" in the app + And I set the field "Search" to "Student1 student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "auto search test" in the app + And I press "Send" in the app + And I press the back button in the app + And I press the back button in the app + And I press "Private" in the app + And I press "Student1 student1" in the app + Then I should see "auto search test" + + @app @3.8.0 @tablet @OK + Scenario: Self conversations (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + Then I should see "Starred (1)" + And I press "Student1 student1" in the app + And I set the field "New message" to "self conversation" in the app + And I press "Send" in the app + And I switch offline mode to "true" + And I set the field "New message" to "self conversation offline" in the app + And I press "Send" in the app + And I switch offline mode to "false" + And I press "Student1 student1" in the app + And I press "Information" in the app + Then I should see "Unstar conversation" + And I should see "Show delete messages" + And I should see "Delete conversation" + And I press "Unstar conversation" in the app + And I press "Information" in the app + Then I should see "Star conversation" + And I should see "Show delete messages" + And I should see "Delete conversation" + And I press "Show delete messages" in the app + And I should see "self conversation" + And I should see "self conversation offline" + And I press "Delete message" near "self conversation offline" in the app + And I press "OK" in the app + Then I should see "self conversation" + And I should not see "self conversation offline" + And I press "Information" in the app + And I press "Delete conversation" in the app + And I press "Delete" in the app + Then I should not see "self conversation" + And I should not see "self conversation offline" + And I press "addon.messages.search" in the app + And I set the field "Search" to "Student1 student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I set the field "New message" to "auto search test" in the app + And I press "Send" in the app + And I press the back button in the app + And I press "Private" in the app + And I press "Student1 student1" in the app + Then I should see "auto search test" \ No newline at end of file From a5b402c63a7795b7b635684b9bc747674532d354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 29 Jan 2020 11:02:31 +0100 Subject: [PATCH 31/61] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index 89696f64f..a3450d45b 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -312,6 +312,35 @@ Feature: Test basic usage of messages in app Then I should see "heeey student" And I should see "byee" + @app @3.8.0 @OK + Scenario: Auto-sync messages + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Contacts" in the app + Then I should see "No contacts" + And I press "addon.messages.search" in the app + And I set the field "Search" to "student1" in the app + And I press "search" in the app + And I press "Student1 student1" in the app + And I switch offline mode to "true" + And I set the field "New message" to "heeey student" in the app + And I press "Send" in the app + And I set the field "New message" to "byee" in the app + And I press "Send" in the app + And I switch offline mode to "false" + And I wait "600" seconds + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Messages" in the app + And I press "Teacher teacher" in the app + Then I should see "heeey student" + And I should see "byee" + @app @3.8.0 @OK Scenario: Search for messages When I enter the app @@ -425,7 +454,7 @@ Feature: Test basic usage of messages in app Then I should see "Teacher teacher" And I should see "Student1 student1" - @app @3.8.0 @mobile @OK + @app @3.8.0 @mobile @OK Scenario: User blocking feature (mobile) When I enter the app And I log in as "student2" @@ -602,7 +631,7 @@ Feature: Test basic usage of messages in app Then I should see "Unmute" And I should not see "Mute" - @app @3.8.0 @mobile @OK + @app @3.8.0 @mobile @OK Scenario: Self conversations (mobile) When I enter the app And I log in as "student1" From 3e801812f0303d62550053526b71a198df3bb525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 29 Jan 2020 12:10:44 +0100 Subject: [PATCH 32/61] MOBILE-3328 behat: Behat basic test for glossary --- .../tests/behat/app_basic_usage.feature | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 mod/glossary/tests/behat/app_basic_usage.feature diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature new file mode 100755 index 000000000..969009a16 --- /dev/null +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -0,0 +1,53 @@ +@mod @mod_glossary @app @javascript +Feature: Test basic usage of glossary in app + In order to participate in the glossaries while using the mobile app + As a student + I need basic glossary functionality to work + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | teacher | teacher1@example.com | + | student1 | Student | student | student1@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 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | glossary | Test glossary | glossary description | C1 | gloss1 | + + @app @3.8.0 @OK + Scenario: View a glossary and its terms + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "car" in the app + And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "mountain" in the app + And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app + And I press "Save" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + And I press "car" in the app + Then I should see "car" + And I should see "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." \ No newline at end of file From 76df2fa31d6b13a6d05f9ffa4e190cfdb4108d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 30 Jan 2020 09:32:51 +0100 Subject: [PATCH 33/61] MOBILE-3328 behat: Behat basic test for glossary --- .../tests/behat/app_basic_usage.feature | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index 969009a16..03b0f9857 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -50,4 +50,41 @@ Feature: Test basic usage of glossary in app And I should see "potato" And I press "car" in the app Then I should see "car" - And I should see "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." \ No newline at end of file + And I should see "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." + + @app @3.8.0 @OK + Scenario: Change filters (include search) + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "car" in the app + And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "mountain" in the app + And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app + And I press "Save" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + And I press "Browse entries" in the app + And I press "Search" in the app + And I set the field "Search query" to "something" in the app + And I press "search" in the app + Then I should see "No entries were found." + And I set the field "Search query" to "potato" in the app + And I press "search" in the app + And I set the field "Search query" to " " in the app + And I press "potato" in the app + Then I should see "potato" + And I should see "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." \ No newline at end of file From 94fda27abb2548faf30bf31855c109bad5039178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 5 Feb 2020 09:58:25 +0100 Subject: [PATCH 34/61] MOBILE-3328 behat: Behat basic test for glossary --- .../tests/behat/app_basic_usage.feature | 111 +++++++++++++++++- 1 file changed, 108 insertions(+), 3 deletions(-) diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index 03b0f9857..e8c938621 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -20,8 +20,12 @@ Feature: Test basic usage of glossary in app | student1 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | - | glossary | Test glossary | glossary description | C1 | gloss1 | + | activity | name | intro | course | idnumber | mainglossary | allowcomments | + | glossary | Test glossary | glossary description | C1 | gloss1 | 1 | 1 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | forum | Test forum name | Test forum | C1 | forum | 0 | @app @3.8.0 @OK Scenario: View a glossary and its terms @@ -87,4 +91,105 @@ Feature: Test basic usage of glossary in app And I set the field "Search query" to " " in the app And I press "potato" in the app Then I should see "potato" - And I should see "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." \ No newline at end of file + And I should see "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." + + @app @3.8.0 + Scenario: Navigate to glossary terms by link (auto-linking) + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "This entry should be automatically linked" in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "car" in the app + And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app + And I press "This entry should be automatically linked" in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "mountain" in the app + And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app + And I press "This entry should be automatically linked" in the app + And I press "Save" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + And I press "Display options" 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 "admin" + And I press "Side panel" + And I follow "Site administration" + And I follow "Plugins" + And I follow "Manage filters" + And I pause + And I click on "newstate" "select" in the "Glossary auto-linking" "table_row" + And I click on "on" "option" in the "single_select5e32c21f9a4f039" "region" + And I pause + + @app @3.8.0 @OK + Scenario: See comments + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "car" in the app + And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "mountain" in the app + And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app + And I press "Save" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + And I press "mountain" in the app + Then I should see "Comments (0)" + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "mountain" in the app + Then I should see "Comments (0)" + And I press "Comments" in the app + And I should see "No comments" + And I press "close" in the app + And I set the field "Add a comment..." to "teacherComment" in the app + And I press "Save comment" in the app + Then I should see "teacherComment" + And I press "close" in the app + And I set the field "Add a comment..." to "teacherComment2" in the app + And I press "Save comment" in the app + Then I should see "teacherComment" + And I should see "teacherComment2" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "mountain" in the app + Then I should see "Comments (2)" + And I press "Comments" in the app + And I should see "teacherComment" + And I should see "teacherComment2" \ No newline at end of file From 288612c077f84329cfdbc375c0256b2adc2b6386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 5 Feb 2020 10:53:07 +0100 Subject: [PATCH 35/61] MOBILE-3328 behat: Behat basic test for glossary --- .../tests/behat/app_basic_usage.feature | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index e8c938621..2ad1353f5 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -192,4 +192,46 @@ Feature: Test basic usage of glossary in app Then I should see "Comments (2)" And I press "Comments" in the app And I should see "teacherComment" - And I should see "teacherComment2" \ No newline at end of file + And I should see "teacherComment2" + + @app @3.8.0 @OK + Scenario: Prefetch + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "car" in the app + And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "mountain" in the app + And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app + And I press "Save" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + And I press "Display options" in the app + And I press "Download" in the app + And I press the back button in the app + And I press the back button in the app + And I press "Course 1" near "Recently accessed courses" in the app + And I switch offline mode to "true" + And I press "Test glossary" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + And I press "mountain" in the app + Then I should see "mountain" + And I should see "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." + And I should not see "Comments cannot be retrieved" + And I should see "Comments (0)" \ No newline at end of file From 8f10d57c0a437c450f394c2757e731e9cefa7ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 5 Feb 2020 11:50:32 +0100 Subject: [PATCH 36/61] MOBILE-3328 behat: Behat basic test for glossary --- .../tests/behat/app_basic_usage.feature | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index 2ad1353f5..20ac48c83 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -193,7 +193,7 @@ Feature: Test basic usage of glossary in app And I press "Comments" in the app And I should see "teacherComment" And I should see "teacherComment2" - + @app @3.8.0 @OK Scenario: Prefetch When I enter the app @@ -234,4 +234,47 @@ Feature: Test basic usage of glossary in app Then I should see "mountain" And I should see "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." And I should not see "Comments cannot be retrieved" - And I should see "Comments (0)" \ No newline at end of file + And I should see "Comments (0)" + + @app @3.8.0 @OK + Scenario: Sync + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I switch offline mode to "true" + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "car" in the app + And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "mountain" in the app + And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app + And I press "Save" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + And I should see "Entries to be synced" + And I should see "This Glossary has offline data to be synchronised." + And I switch offline mode to "false" + And I press "close" in the app + And I set the field "Concept" to "testSync" in the app + And I set the field "Definition" to "testSync" in the app + And I press "Save" in the app + And I press "Display options" in the app + And I press "Synchronise now" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + And I should see "testSync" + And I should not see "Entries to be synced" + And I should not see "This Glossary has offline data to be synchronised." \ No newline at end of file From e53b8cfe28367751dc456a452115917538fc3168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 6 Feb 2020 10:29:41 +0100 Subject: [PATCH 37/61] MOBILE-3328 behat: Behat basic test for glossary --- .../tests/behat/app_basic_usage.feature | 149 +++++++++++++++++- 1 file changed, 144 insertions(+), 5 deletions(-) diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index 20ac48c83..97b67c995 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -7,8 +7,9 @@ Feature: Test basic usage of glossary in app Background: Given the following "users" exist: | username | firstname | lastname | email | - | teacher1 | Teacher | teacher | teacher1@example.com | - | student1 | Student | student | student1@example.com | + | teacher1 | Teacher | teacher | teacher1@example.com | + | teacher2 | Teacher2 | teacher2 | teacher2@example.com | + | student1 | Student | student | student1@example.com | And the following "courses" exist: | fullname | shortname | category | @@ -17,11 +18,12 @@ Feature: Test basic usage of glossary in app And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + | teacher2 | C1 | editingteacher | | student1 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | mainglossary | allowcomments | - | glossary | Test glossary | glossary description | C1 | gloss1 | 1 | 1 | + | activity | name | intro | course | idnumber | mainglossary | allowcomments | assessed | scale | + | glossary | Test glossary | glossary description | C1 | gloss1 | 1 | 1 | 1 | 1 | And the following "activities" exist: | activity | name | intro | course | idnumber | groupmode | @@ -277,4 +279,141 @@ Feature: Test basic usage of glossary in app And I should see "potato" And I should see "testSync" And I should not see "Entries to be synced" - And I should not see "This Glossary has offline data to be synchronised." \ No newline at end of file + And I should not see "This Glossary has offline data to be synchronised." + + @app @3.8.0 @mobile @OK + Scenario: Add/view ratings (mobile) + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "car" in the app + And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "mountain" in the app + And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app + And I press "Save" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "mountain" in the app + Then I should see "Average of ratings: -" + And I press "None" in the app + And I press "1" in the app + Then I should see "Average of ratings: 1" + When I enter the app + And I log in as "teacher2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "mountain" in the app + And I switch offline mode to "true" + And I press "None" in the app + And I press "0" in the app + Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later." + And I should see "Average of ratings: 1" + And I switch offline mode to "false" + And I press the back button in the app + Then I should see "This Glossary has offline data to be synchronised." + And I press "Display options" in the app + And I press "Synchronise now" in the app + And I press "mountain" in the app + Then I should see "Average of ratings: 0.5" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "mountain" in the app + Then the header should be "mountain" in the app + And I should not see "Average of ratings: 0.5" + + @app @3.8.0 @tablet @OK + Scenario: Add/view ratings (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "car" in the app + And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "mountain" in the app + And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app + And I press "Save" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "mountain" in the app + Then I should see "Average of ratings: -" + And I press "None" in the app + And I press "1" in the app + Then I should see "Average of ratings: 1" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "mountain" in the app + And I switch offline mode to "true" + And I press "None" in the app + And I press "0" in the app + Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later." + And I should see "Average of ratings: 1" + And I switch offline mode to "false" + Then I should see "This Glossary has offline data to be synchronised." + And I press "Display options" in the app + And I press "Synchronise now" in the app + Then I should see "Average of ratings: 0.5" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "mountain" in the app + Then I should not see "Average of ratings: 0.5" \ No newline at end of file From 8f6c39ba2ab6d1176d27b58fcececc08acb4c798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 6 Feb 2020 12:13:04 +0100 Subject: [PATCH 38/61] MOBILE-3295 behat: Behat basic test for forum --- mod/forum/tests/behat/app_basic_usage.feature | 87 +++++++++++++++++-- 1 file changed, 78 insertions(+), 9 deletions(-) diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index 48cea02da..81f08fd83 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -21,8 +21,8 @@ Feature: Test basic usage of forum activity in app | teacher1 | C1 | editingteacher | | teacher2 | C1 | editingteacher | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | assessed | scale[modgrade_type] | - | forum | Test forum name | Test forum | C1 | forum | 0 | 5 | Point | + | activity | name | intro | course | idnumber | groupmode | assessed | scale | + | forum | Test forum name | Test forum | C1 | forum | 0 | 1 | 1 | @app @3.8.0 @OK Scenario: Student starts a discussion @@ -207,15 +207,15 @@ Feature: Test basic usage of forum activity in app And I press "Auto-test" in the app And I wait "2" seconds And I pause - And I press "Auto-test" near "Information" in the app + And I press "more" in the app And I pause And I should see "Edit" And I pause And I switch offline mode to "true" And I pause - @app @mobile @3.8.0 - Scenario: Add/view ratings + @app @3.8.0 @mobile @OK + Scenario: Add/view ratings (mobile) When I enter the app And I log in as "student1" And I press "Course 1" near "Course overview" in the app @@ -226,14 +226,83 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app And I press "Auto-test" in the app And I press "Reply" in the app - And I set the field "Write your reply..." to "test" in the app + And I set the field "Write your reply..." to "test2" in the app And I press "Post to forum" in the app When I enter the app - And I log in as "student2" + And I log in as "teacher1" And I press "Course 1" near "Course overview" in the app And I press "Test forum name" in the app And I press "Auto-test" in the app - And I pause + And I press "None" near "Auto-test message" in the app + And I press "1" near "Cancel" in the app + And I switch offline mode to "true" + And I press "None" near "test2" in the app + And I press "0" near "Cancel" in the app + Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later." + And I should see "Average of ratings: -" + And I should see "Average of ratings: 1" + And I switch offline mode to "false" + And I press the back button in the app + Then I should see "This Forum has offline data to be synchronised." + And I press "Display options" near "Test forum name" in the app + And I press "Synchronise now" in the app + And I should not see "This Forum has offline data to be synchronised." + And I press "Auto-test" in the app + Then I should see "Average of ratings: 1" + And I should see "Average of ratings: 0" + And I should not see "Average of ratings: -" + 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 forum name" in the app + And I press "Auto-test" in the app + Then I should see "Average of ratings: 1" + And I should see "Average of ratings: 0" + And I should not see "Average of ratings: -" + + @app @3.8.0 @tablet @OK + Scenario: Add/view ratings (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test" in the app + And I set the field "Message" to "Auto-test message" in the app + And I press "Post to forum" in the app + And I press "Reply" in the app + And I set the field "Write your reply..." to "test2" in the app + And I press "Post to forum" in the app + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + And I press "None" near "Auto-test message" in the app + And I press "1" near "Cancel" in the app + And I switch offline mode to "true" + And I press "None" near "test2" in the app + And I press "0" near "Cancel" in the app + Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later." + And I should see "Average of ratings: -" + And I should see "Average of ratings: 1" + And I switch offline mode to "false" + Then I should see "This Forum has offline data to be synchronised." + And I press "Display options" near "Test forum name" in the app + And I press "Synchronise now" in the app + And I should not see "This Forum has offline data to be synchronised." + Then I should see "Average of ratings: 1" + And I should see "Average of ratings: 0" + And I should not see "Average of ratings: -" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + Then I should see "Average of ratings: 1" + And I should see "Average of ratings: 0" + And I should not see "Average of ratings: -" @app @3.8.0 @mobile @OK Scenario: Student replies a post offline mobile @@ -438,4 +507,4 @@ Feature: Test basic usage of forum activity in app And I press "Reply" in the app And I set the field "Write your reply" to "ReplyMessage" in the app And I press "Post to forum" in the app - And I pause \ No newline at end of file + And I pauses \ No newline at end of file From ca1cca07f6ae61a343d1460ba1d54a7b2210eb0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Fri, 7 Feb 2020 12:06:44 +0100 Subject: [PATCH 39/61] Fix Display options button --- .../tests/behat/app_basic_usage.feature | 6 ++-- .../tests/behat/app_basic_usage.feature | 8 ++--- .../tests/behat/app_basic_usage.feature | 2 +- mod/forum/tests/behat/app_basic_usage.feature | 29 ++++++++++--------- .../tests/behat/app_basic_usage.feature | 18 ++++++------ .../tests/behat/app_basic_usage.feature | 4 +-- 6 files changed, 34 insertions(+), 33 deletions(-) diff --git a/mod/choice/tests/behat/app_basic_usage.feature b/mod/choice/tests/behat/app_basic_usage.feature index 24ee2e68c..22fd3ec66 100755 --- a/mod/choice/tests/behat/app_basic_usage.feature +++ b/mod/choice/tests/behat/app_basic_usage.feature @@ -96,7 +96,7 @@ Feature: Test basic usage of choice activity in app And I switch offline mode to "false" And I press the back button in the app And I press "Test single choice name" in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Refresh" in the app Then I should see "Option 1: 0" And I should see "Option 2: 1" @@ -137,7 +137,7 @@ Feature: Test basic usage of choice activity in app 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 "Information" in the app + And I press "Display options" in the app And I press "Show download options" in the app And I press "cloud download" near "Test single choice name" in the app And I switch offline mode to "true" @@ -180,7 +180,7 @@ Feature: Test basic usage of choice activity in app And I log in as "teacher1" And I press "Course 1" near "Course overview" in the app And I press "Choice name" in the app - And I press "Information" in the app + And I press "Display options" 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" diff --git a/mod/course/tests/behat/app_basic_usage.feature b/mod/course/tests/behat/app_basic_usage.feature index 7452476e0..a42f3154b 100755 --- a/mod/course/tests/behat/app_basic_usage.feature +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -397,7 +397,7 @@ Feature: Test basic usage of one course in app Then the header should be "Acceptance test site" in the app And I should see "Course 1" And I press "Course 1" near "Recently accessed courses" in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Course summary" in the app And I press "Open in browser" in the app And I switch to the browser tab opened by the app @@ -440,7 +440,7 @@ Feature: Test basic usage of one course in app Then the header should be "Acceptance test site" in the app And I should see "Course 1" And I press "Course 1" near "Recently accessed courses" in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Course summary" in the app And I press "Open in browser" in the app And I switch to the browser tab opened by the app @@ -482,7 +482,7 @@ Feature: Test basic usage of one course in app Then the header should be "Acceptance test site" in the app And I should see "Course 1" And I press "Course 1" near "Recently accessed courses" in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Course summary" in the app And I press "Open in browser" in the app And I switch to the browser tab opened by the app @@ -533,7 +533,7 @@ Feature: Test basic usage of one course in app Then the header should be "Acceptance test site" in the app And I should see "Course 1" And I press "Course 1" near "Recently accessed courses" in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Course summary" in the app And I press "Open in browser" in the app And I switch to the browser tab opened by the app diff --git a/mod/courses/tests/behat/app_basic_usage.feature b/mod/courses/tests/behat/app_basic_usage.feature index a22581dec..cf3244604 100755 --- a/mod/courses/tests/behat/app_basic_usage.feature +++ b/mod/courses/tests/behat/app_basic_usage.feature @@ -114,7 +114,7 @@ Feature: Test basic usage of courses in app And I should see "Timeline" And I press "Course 1" near "Recently accessed courses" in the app And I press "assignment" in the app - And I press "Information" in the app + And I press "Display options" 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" diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index 81f08fd83..ade2e6569 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -105,7 +105,7 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app And I press "Auto-test star" near "Last post a minute ago" in the app Then I should see "Auto-test star message" - And I press "Information" in the app + And I press "Display options" in the app And I press "Star this discussion" in the app And I press the back button in the app And I press "Auto-test star" near "Last post a minute ago" in the app @@ -116,7 +116,7 @@ Feature: Test basic usage of forum activity in app And I press the back button in the app And I press "Auto-test star" near "Last post a minute ago" in the app And I wait "1" seconds - And I press "Information" in the app + And I press "Display options" in the app And I press "Unstar this discussion" in the app And I press the back button in the app And I press "Auto-test star" near "Last post a few seconds ago" in the app @@ -145,12 +145,12 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app And I press "Auto-test star" in the app And I wait "1" seconds - And I press "Information" in the app + And I press "Display options" in the app And I press "Star this discussion" in the app And I press the back button in the app And I press "Auto-test pin" in the app And I wait "1" seconds - And I press "Information" in the app + And I press "Display options" in the app And I press "Pin this discussion" in the app And I press the back button in the app And I should see "Auto-test pin" @@ -159,12 +159,12 @@ Feature: Test basic usage of forum activity in app And I pause And I press "Auto-test pin" in the app And I wait "1" seconds - And I press "Information" in the app + And I press "Display options" in the app And I press "Unpin this discussion" in the app And I press the back button in the app And I press "Auto-test star" in the app And I wait "1" seconds - And I press "Information" in the app + And I press "Display options" in the app And I press "Unstar this discussion" in the app And I press the back button in the app Then I should see "Auto-test star" @@ -183,7 +183,7 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app And I press "Auto-test" in the app And I wait "1" seconds - And I press "Information" in the app + And I press "Display options" in the app Then I should not see "Star this discussion" And I should not see "Pin this discussion" @@ -200,7 +200,8 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app Then I should see "Auto-test" And I press the back button in the app - And I press "Information" in the app + And I pause + And I press "Display options" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app And I press "Test forum name" in the app @@ -315,7 +316,7 @@ Feature: Test basic usage of forum activity in app And I set the field "Message" to "DiscussionMessage" in the app And I press "Post to forum" in the app And I press the back button in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app And I press "Test forum name" in the app @@ -346,7 +347,7 @@ Feature: Test basic usage of forum activity in app And I set the field "Message" to "DiscussionMessage" in the app And I press "Post to forum" in the app And I press the back button in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app And I press "Test forum name" in the app @@ -383,7 +384,7 @@ Feature: Test basic usage of forum activity in app And I switch offline mode to "false" And I press the back button in the app And I press "Test forum name" in the app - And I press "Information" in the app + And I press "Display options" near "Test forum name" in the app And I press "Refresh discussions" in the app And I press "DiscussionSubject" near "Sort by last post creation date in descending order" in the app Then I should see "DiscussionSubject" @@ -426,7 +427,7 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app Then I should see "DiscussionSubject" And I press the back button in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app And I press "Test forum name" in the app @@ -462,7 +463,7 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app Then I should see "DiscussionSubject" And I press the back button in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app And I press "Test forum name" in the app @@ -507,4 +508,4 @@ Feature: Test basic usage of forum activity in app And I press "Reply" in the app And I set the field "Write your reply" to "ReplyMessage" in the app And I press "Post to forum" in the app - And I pauses \ No newline at end of file + And I pause \ No newline at end of file diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index a3450d45b..f887e0f09 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -74,7 +74,7 @@ Feature: Test basic usage of messages in app And I press "Student1 student1" in the app And I set the field "New message" to "heeey student" in the app And I press "Send" in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Add to contacts" in the app And I press "Add" in the app When I enter the app @@ -221,7 +221,7 @@ Feature: Test basic usage of messages in app And I press "Student1 student1" in the app And I set the field "New message" to "heeey student" in the app And I press "Send" in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Add to contacts" in the app And I press "Add" in the app Then I should see "Contact request sent" @@ -241,10 +241,10 @@ Feature: Test basic usage of messages in app And I press "Send" in the app Then I should see "heeey student" And I should see "hi" - And I press "Information" in the app + And I press "Display options" in the app And I press "Remove from contacts" in the app And I press "Remove" in the app - And I press "Information" in the app + And I press "Display options" in the app Then I should see "Add to contacts" And I press "Delete conversation" in the app And I press "Delete" in the app @@ -446,7 +446,7 @@ Feature: Test basic usage of messages in app Then I should see "Private (2)" And I should see "Starred (1)" And I press "star message" in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Star conversation" in the app Then I should see "Private (1)" And I should see "Starred (2)" @@ -627,7 +627,7 @@ Feature: Test basic usage of messages in app And I press "Messages" in the app And I press "Private (1)" in the app And I press "Student2 student2" in the app - And I press "Information" in the app + And I press "Display options" in the app Then I should see "Unmute" And I should not see "Mute" @@ -699,12 +699,12 @@ Feature: Test basic usage of messages in app And I press "Send" in the app And I switch offline mode to "false" And I press "Student1 student1" in the app - And I press "Information" in the app + And I press "Display options" in the app Then I should see "Unstar conversation" And I should see "Show delete messages" And I should see "Delete conversation" And I press "Unstar conversation" in the app - And I press "Information" in the app + And I press "Display options" in the app Then I should see "Star conversation" And I should see "Show delete messages" And I should see "Delete conversation" @@ -715,7 +715,7 @@ Feature: Test basic usage of messages in app And I press "OK" in the app Then I should see "self conversation" And I should not see "self conversation offline" - And I press "Information" in the app + And I press "Display options" in the app And I press "Delete conversation" in the app And I press "Delete" in the app Then I should not see "self conversation" diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature index 08fa78a6c..ad2152693 100755 --- a/mod/survey/tests/behat/app_basic_usage.feature +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -567,7 +567,7 @@ Feature: Test basic usage of survey activity in app And I switch offline mode to "false" And I press the back button in the app And I press "Test survey critical incidents" in the app - And I press "Information" in the app + And I press "Display options" in the app And I press "Refresh" in the app Then I should see "Results" And I should not see "This Survey has offline data to be synchronised." @@ -581,7 +581,7 @@ Feature: Test basic usage of survey activity in app 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 "Information" in the app + And I press "Display options" in the app And I press "Show download options" in the app And I press "cloud download" near "Test survey critical incidents" in the app And I switch offline mode to "true" From f71454504eda8d1a289f2767259311a2e68416f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 10 Feb 2020 09:25:08 +0100 Subject: [PATCH 40/61] MOBILE-3295 behat: Behat basic test for forum --- mod/forum/tests/behat/app_basic_usage.feature | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index ade2e6569..b7737e7de 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -38,7 +38,6 @@ Feature: Test basic usage of forum activity in app And I press "My happy subject" in the app And I should see "An awesome message" - @app_upto3.6.1 Scenario: Student posts a reply When I enter the app @@ -187,8 +186,7 @@ Feature: Test basic usage of forum activity in app Then I should not see "Star this discussion" And I should not see "Pin this discussion" - - @app @mobile @3.8.0 + @app @3.8.0 @OK Scenario: Edit a forum post (only online) When I enter the app And I log in as "student1" @@ -200,20 +198,21 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app Then I should see "Auto-test" And I press the back button in the app - And I pause And I press "Display options" in the app And I press "Show download options" in the app And I press "cloud download" near "Test forum name" in the app And I press "Test forum name" in the app - And I press "Auto-test" in the app - And I wait "2" seconds - And I pause - And I press "more" in the app - And I pause - And I should see "Edit" - And I pause + And I press "Auto-test" near "Sort by last post creation date in descending order" in the app + And I press "Display options" near "Reply" in the app + Then I should see "Edit" + And I press "Edit" in the app + And I set the field "Write your reply..." to "Auto-test message edited" in the app + And I press "Save changes" And I switch offline mode to "true" - And I pause + And I press "Display options" near "Reply" in the app + Then I should see "There was a problem connecting to the site. Please check your connection and try again." + And I press "OK" in the app + And I should not see "Edit" @app @3.8.0 @mobile @OK Scenario: Add/view ratings (mobile) @@ -449,7 +448,6 @@ Feature: Test basic usage of forum activity in app And I should see "DiscussionMessage" And I should not see "There was a problem connecting to the site. Please check your connection and try again." - @app @3.8.0 @tablet @OK Scenario: Prefetch tablet When I enter the app From 298dc89c06eae395907ec1779fd319e3a539ef4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 10 Feb 2020 09:49:39 +0100 Subject: [PATCH 41/61] MOBILE-3295 behat: Behat basic test for forum --- mod/forum/tests/behat/app_basic_usage.feature | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index b7737e7de..2ff80e1ec 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -214,6 +214,38 @@ Feature: Test basic usage of forum activity in app And I press "OK" in the app And I should not see "Edit" + @app @3.8.0 @OK + Scenario: Delete a forum post (only online) + 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 forum name" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test" in the app + And I set the field "Message" to "Auto-test message" in the app + And I press "Post to forum" in the app + Then I should see "Auto-test" + And I press the back button in the app + And I press "Display options" in the app + And I press "Show download options" in the app + And I press "cloud download" near "Test forum name" in the app + And I press "Test forum name" in the app + And I press "Auto-test" near "Sort by last post creation date in descending order" in the app + And I press "Display options" near "Reply" in the app + Then I should see "Delete" + And I press "Delete" in the app + And I press "Cancel" in the app + And I switch offline mode to "true" + And I press "Display options" near "Reply" in the app + Then I should see "There was a problem connecting to the site. Please check your connection and try again." + And I press "OK" in the app + And I should not see "Delete" + And I switch offline mode to "false" + And I press "Display options" near "Reply" in the app + And I press "Delete" in the app + And I press "Delete" in the app + Then I should not see "Auto-test" + @app @3.8.0 @mobile @OK Scenario: Add/view ratings (mobile) When I enter the app From e4a87e06fb0740a4a7616e9223bec451c8f9b16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 10 Feb 2020 10:48:44 +0100 Subject: [PATCH 42/61] MOBILE-3295 behat: Behat basic test for forum --- mod/forum/tests/behat/app_basic_usage.feature | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index 2ff80e1ec..cf78898f2 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -186,6 +186,63 @@ Feature: Test basic usage of forum activity in app Then I should not see "Star this discussion" And I should not see "Pin this discussion" + @app @3.8.0 @mobile @OK + Scenario: Edit a not sent reply offline (mobile) + 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 forum name" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test" in the app + And I set the field "Message" to "Auto-test message" in the app + And I press "Post to forum" in the app + And I press "Auto-test" near "Sort by last post creation date in descending order" in the app + And I switch offline mode to "true" + And I press "Reply" in the app + And I set the field "Write your reply..." to "not sent reply" in the app + And I press "Post to forum" in the app + And I press "Display options" near "not sent reply" in the app + Then I should see "Edit" + And I press "Edit" in the app + And I set the field "Write your reply..." to "not sent reply edited" in the app + And I press "Post to forum" in the app + Then I should see "Not sent" + And I should see "This Discussion has offline data to be synchronised" + And I switch offline mode to "false" + And I press the back button in the app + And I press "Auto-test" near "Sort by last post creation date in descending order" in the app + Then I should not see "Not sent" + And I should not see "This Discussion has offline data to be synchronised" + + @app @3.8.0 @tablet @OK + Scenario: Edit a not sent reply offline (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test" in the app + And I set the field "Message" to "Auto-test message" in the app + And I press "Post to forum" in the app + And I press "Auto-test" near "Sort by last post creation date in descending order" in the app + And I switch offline mode to "true" + And I press "Reply" in the app + And I set the field "Write your reply..." to "not sent reply" in the app + And I press "Post to forum" in the app + And I press "Display options" near "not sent reply" in the app + Then I should see "Edit" + And I press "Edit" in the app + And I set the field "Write your reply..." to "not sent reply edited" in the app + And I press "Post to forum" in the app + Then I should see "Not sent" + And I should see "This Discussion has offline data to be synchronised" + And I switch offline mode to "false" + And I press the back button in the app + And I press "Test forum name" in the app + Then I should not see "Not sent" + And I should not see "This Discussion has offline data to be synchronised" + @app @3.8.0 @OK Scenario: Edit a forum post (only online) When I enter the app From 626786a47112375cdca7bb2b4550d90eea400976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 10 Feb 2020 11:22:12 +0100 Subject: [PATCH 43/61] MOBILE-3295 behat: Behat basic test for forum --- mod/forum/tests/behat/app_basic_usage.feature | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index cf78898f2..56a160db8 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -243,6 +243,28 @@ Feature: Test basic usage of forum activity in app Then I should not see "Not sent" And I should not see "This Discussion has offline data to be synchronised" + @app @3.8.0 @OK + Scenario: Edit a not sent new discussion offline + 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 forum name" in the app + And I switch offline mode to "true" + And I press "close" in the app + And I set the field "Subject" to "Auto-test" in the app + And I set the field "Message" to "Auto-test message" in the app + And I press "Post to forum" in the app + And I press "Auto-test" in the app + And I set the field "Message" to "Auto-test message edited" in the app + And I press "Post to forum" in the app + Then I should see "This Forum has offline data to be synchronised." + And I switch offline mode to "false" + And I press "Auto-test" in the app + And I press "Post to forum" in the app + Then I should not see "This Forum has offline data to be synchronised." + And I press "Auto-test" near "Sort by last post creation date in descending order" in the app + And I should see "Auto-test message edited" + @app @3.8.0 @OK Scenario: Edit a forum post (only online) When I enter the app @@ -264,7 +286,7 @@ Feature: Test basic usage of forum activity in app Then I should see "Edit" And I press "Edit" in the app And I set the field "Write your reply..." to "Auto-test message edited" in the app - And I press "Save changes" + And I press "Save changes" in the app And I switch offline mode to "true" And I press "Display options" near "Reply" in the app Then I should see "There was a problem connecting to the site. Please check your connection and try again." @@ -302,7 +324,7 @@ Feature: Test basic usage of forum activity in app And I press "Delete" in the app And I press "Delete" in the app Then I should not see "Auto-test" - + @app @3.8.0 @mobile @OK Scenario: Add/view ratings (mobile) When I enter the app From 4108ea15d872114a3ee2d8b71c2671f8dec96de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Tue, 11 Feb 2020 10:04:36 +0100 Subject: [PATCH 44/61] MOBILE-3295 behat: Behat basic test for forum --- mod/forum/tests/behat/app_basic_usage.feature | 107 ++++++++---------- 1 file changed, 49 insertions(+), 58 deletions(-) diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index 56a160db8..af3f0f42c 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -24,8 +24,8 @@ Feature: Test basic usage of forum activity in app | activity | name | intro | course | idnumber | groupmode | assessed | scale | | forum | Test forum name | Test forum | C1 | forum | 0 | 1 | 1 | - @app @3.8.0 @OK - Scenario: Student starts a discussion + @app @3.8.0 @OK + Scenario: Student starts a discussion When I enter the app And I log in as "student1" And I press "Course 1" near "Course overview" in the app @@ -38,8 +38,8 @@ Feature: Test basic usage of forum activity in app And I press "My happy subject" in the app And I should see "An awesome message" - @app_upto3.6.1 - Scenario: Student posts a reply + @app_upto3.6.1 + Scenario: Student posts a reply When I enter the app And I log in as "student1" And I press "Course 1" near "Course overview" in the app @@ -55,8 +55,8 @@ Feature: Test basic usage of forum activity in app Then I should see "DiscussionMessage" And I should see "ReplyMessage" - @app_from3.7 - Scenario: Student posts a reply + @app_from3.7 + Scenario: Student posts a reply When I enter the app And I log in as "student1" And I press "Course 1" near "Course overview" in the app @@ -72,7 +72,7 @@ Feature: Test basic usage of forum activity in app Then I should see "DiscussionMessage" And I should see "ReplyMessage" - Scenario: Test that 'open in browser' works for forum + Scenario: Test that 'open in browser' works for forum When I enter the app And I change viewport size to "360x640" And I log in as "student1" @@ -87,8 +87,8 @@ Feature: Test basic usage of forum activity in app And I close the browser tab opened by the app And I press the back button in the app - @app @mobile @3.8.0 - Scenario: Student stars a discussion + @app @3.8.0 @mobile @OK + Scenario: Student stars a discussion (mobile) When I enter the app And I log in as "student1" And I press "Course 1" near "Course overview" in the app @@ -104,27 +104,55 @@ Feature: Test basic usage of forum activity in app And I press "Post to forum" in the app And I press "Auto-test star" near "Last post a minute ago" in the app Then I should see "Auto-test star message" - And I press "Display options" in the app - And I press "Star this discussion" in the app And I press the back button in the app + And I press "Display options" near "Last post a minute ago" in the app + And I press "Star this discussion" in the app And I press "Auto-test star" near "Last post a minute ago" in the app Then I should see "Auto-test star message" And I press the back button in the app And I press "Auto-test star" near "Last post a few seconds ago" in the app Then I should see "Auto-test no star message" And I press the back button in the app - And I press "Auto-test star" near "Last post a minute ago" in the app - And I wait "1" seconds - And I press "Display options" in the app + And I press "Display options" near "Last post a minute ago" in the app And I press "Unstar this discussion" in the app - And I press the back button in the app And I press "Auto-test star" near "Last post a few seconds ago" in the app Then I should see "Auto-test no star message" And I press the back button in the app And I press "Auto-test star" near "Last post a minute ago" in the app Then I should see "Auto-test star message" - @app @mobile @3.8.0 + @app @3.8.0 @tablet @OK + Scenario: Student stars a discussion (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + And I press "Course 1" near "Course overview" in the app + And I press "Test forum name" in the app + And I press "close" in the app + And I set the field "Subject" to "Auto-test star" in the app + And I set the field "Message" to "Auto-test star message" in the app + And I press "Post to forum" in the app + And I wait "60" seconds + And I press "close" in the app + And I set the field "Subject" to "Auto-test star" in the app + And I set the field "Message" to "Auto-test no star message" in the app + And I press "Post to forum" in the app + And I press "Auto-test star" near "Last post a minute ago" in the app + Then I should see "Auto-test star message" + And I press "Display options" near "Last post a minute ago" in the app + And I press "Star this discussion" in the app + And I press "Auto-test star" near "Last post a minute ago" in the app + Then I should see "Auto-test star message" + And I press "Auto-test star" near "Last post a few seconds ago" in the app + Then I should see "Auto-test no star message" + And I press "Display options" near "Last post a minute ago" in the app + And I press "Unstar this discussion" in the app + And I press "Auto-test star" near "Last post a few seconds ago" in the app + Then I should see "Auto-test no star message" + And I press "Auto-test star" near "Last post a minute ago" in the app + Then I should see "Auto-test star message" + + @app @3.8.0 @OK Scenario: Teacher star and pin a discussion When I enter the app And I log in as "teacher1" @@ -142,33 +170,19 @@ Feature: Test basic usage of forum activity in app And I set the field "Subject" to "Auto-test" in the app And I set the field "Message" to "Auto-test message" in the app And I press "Post to forum" in the app - And I press "Auto-test star" in the app - And I wait "1" seconds - And I press "Display options" in the app + And I press "Display options" near "Auto-test star" in the app And I press "Star this discussion" in the app - And I press the back button in the app - And I press "Auto-test pin" in the app - And I wait "1" seconds - And I press "Display options" in the app + And I press "Display options" near "Auto-test pin" in the app And I press "Pin this discussion" in the app - And I press the back button in the app And I should see "Auto-test pin" And I should see "Auto-test star" And I should see "Auto-test" - And I pause - And I press "Auto-test pin" in the app - And I wait "1" seconds - And I press "Display options" in the app + And I press "Display options" near "Auto-test pin" in the app And I press "Unpin this discussion" in the app - And I press the back button in the app - And I press "Auto-test star" in the app - And I wait "1" seconds - And I press "Display options" in the app + And I press "Display options" near "Auto-test star" in the app And I press "Unstar this discussion" in the app - And I press the back button in the app Then I should see "Auto-test star" And I should see "Auto-test pin" - And I pause @app @mobile @3.6 @OK Scenario: Teacher checks pin and star in 3.6 @@ -594,27 +608,4 @@ Feature: Test basic usage of forum activity in app And I press the back button in the app And I switch offline mode to "false" And I press "refresh" near "Test forum name" in the app - Then I should not see "There was a problem connecting to the site. Please check your connection and try again." - - @app @3.8.0 - Scenario: Student sorts a forum discussion - 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 forum name" in the app - And I press "Add a new discussion topic" in the app - And I set the field "Subject" to "DiscussionSubject" in the app - And I set the field "Message" to "DiscussionMessage" in the app - And I press "Post to forum" in the app - Then I should see "DiscussionSubject" - And I press "Add a new discussion topic" in the app - And I set the field "Subject" to "DiscussionSubject more replies" in the app - And I set the field "Message" to "DiscussionMessage more replies" in the app - And I press "Post to forum" in the app - Then I should see "DiscussionSubject" - And I should see "DiscussionSubject more replies" - And I press "DiscussionSubject more replies" in the app - And I press "Reply" in the app - And I set the field "Write your reply" to "ReplyMessage" in the app - And I press "Post to forum" in the app - And I pause \ No newline at end of file + Then I should not see "There was a problem connecting to the site. Please check your connection and try again." \ No newline at end of file From 7d8074cccac73f9c21bf0faf6caadb71d74c5a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 12 Feb 2020 09:06:31 +0100 Subject: [PATCH 45/61] MOBILE-3295 MOBILE-3297 behat: Improvement on forum and survey behat --- mod/forum/tests/behat/app_basic_usage.feature | 37 +------------------ .../tests/behat/app_basic_usage.feature | 6 +-- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index af3f0f42c..d913a45a0 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -38,23 +38,6 @@ Feature: Test basic usage of forum activity in app And I press "My happy subject" in the app And I should see "An awesome message" - @app_upto3.6.1 - Scenario: Student posts a reply - 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 forum name" in the app - And I press "Add a new discussion topic" in the app - And I set the field "Subject" to "DiscussionSubject" in the app - And I set the field "Message" to "DiscussionMessage" in the app - And I press "Post to forum" in the app - And I press "DiscussionSubject" in the app - And I press "Reply" in the app - And I set the field "Message" to "ReplyMessage" in the app - And I press "Post to forum" in the app - Then I should see "DiscussionMessage" - And I should see "ReplyMessage" - @app_from3.7 Scenario: Student posts a reply When I enter the app @@ -72,21 +55,6 @@ Feature: Test basic usage of forum activity in app Then I should see "DiscussionMessage" And I should see "ReplyMessage" - Scenario: Test that 'open in browser' works for forum - When I enter the app - And I change viewport size to "360x640" - And I log in as "student1" - And I press "Course 1" near "Course overview" in the app - And I press "Test forum name" in the app - And I press the page menu button 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 "student1" - Then I should see "Test forum name" - And I should see "Add a new discussion topic" - And I close the browser tab opened by the app - And I press the back button in the app - @app @3.8.0 @mobile @OK Scenario: Student stars a discussion (mobile) When I enter the app @@ -184,7 +152,7 @@ Feature: Test basic usage of forum activity in app Then I should see "Auto-test star" And I should see "Auto-test pin" - @app @mobile @3.6 @OK + @app_upto3.6.0 @OK Scenario: Teacher checks pin and star in 3.6 When I enter the app And I log in as "teacher1" @@ -195,8 +163,7 @@ Feature: Test basic usage of forum activity in app And I set the field "Message" to "Auto-test message" in the app And I press "Post to forum" in the app And I press "Auto-test" in the app - And I wait "1" seconds - And I press "Display options" in the app + And I press "Information" in the app Then I should not see "Star this discussion" And I should not see "Pin this discussion" diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature index ad2152693..12aeb3487 100755 --- a/mod/survey/tests/behat/app_basic_usage.feature +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -242,7 +242,6 @@ Feature: Test basic usage of survey activity in app Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." And I should see "1 people have completed this survey so far" - @app @3.8.0 @mobile @OK Scenario: Student answers a survey of Colles (preferred) and see results mobile Given the following "activities" exist: @@ -252,7 +251,6 @@ Feature: Test basic usage of survey activity in app And I log in as "student1" And I press "Course 1" near "Course overview" in the app And I press "Test survey Colles (preferred)" in the app - And I pause And I press "Choose" near "1. my learning focuses on issues that interest me." in the app And I press "Sometimes" near "Often" in the app And I press "Choose" near "2. what I learn is important for my professional practice." in the app @@ -313,7 +311,6 @@ Feature: Test basic usage of survey activity in app Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." And I should see "1 people have completed this survey so far" - @app @3.8.0 @tablet @OK Scenario: Student answers a survey of Colles (preferred) and see results tablet Given the following "activities" exist: @@ -549,8 +546,7 @@ Feature: Test basic usage of survey activity in app And I log in as "student1" Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." And I should see "1 people have completed this survey so far" - - + @app @3.8.0 @OK Scenario: Student answers a survey offline and sync survey Given the following "activities" exist: From 34c947f90e34bc30526f5555f873911bcb94ad9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 12 Feb 2020 10:09:38 +0100 Subject: [PATCH 46/61] MOBILE-3328 behat: Improvement on glossary behat --- .../tests/behat/app_basic_usage.feature | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index 97b67c995..43e8ec9bd 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -95,47 +95,6 @@ Feature: Test basic usage of glossary in app Then I should see "potato" And I should see "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." - @app @3.8.0 - Scenario: Navigate to glossary terms by link (auto-linking) - When I enter the app - And I log in as "student1" - Then the header should be "Acceptance test site" in the app - And I should see "Course 1" - And I press "Course 1" near "Recently accessed courses" in the app - Then the header should be "Course 1" in the app - And I press "Test glossary" in the app - And I press "close" in the app - And I set the field "Concept" to "potato" in the app - And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app - And I press "This entry should be automatically linked" in the app - And I press "Save" in the app - And I press "close" in the app - And I set the field "Concept" to "car" in the app - And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app - And I press "This entry should be automatically linked" in the app - And I press "Save" in the app - And I press "close" in the app - And I set the field "Concept" to "mountain" in the app - And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app - And I press "This entry should be automatically linked" in the app - And I press "Save" in the app - Then the header should be "Test glossary" in the app - And I should see "car" - And I should see "mountain" - And I should see "potato" - And I press "Display options" 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 "admin" - And I press "Side panel" - And I follow "Site administration" - And I follow "Plugins" - And I follow "Manage filters" - And I pause - And I click on "newstate" "select" in the "Glossary auto-linking" "table_row" - And I click on "on" "option" in the "single_select5e32c21f9a4f039" "region" - And I pause - @app @3.8.0 @OK Scenario: See comments When I enter the app From 63b7c6219812e0372b61655b22a836c32c26025a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 12 Feb 2020 12:07:35 +0100 Subject: [PATCH 47/61] MOBILE-3342 behat: Behat basic test for comments --- .../tests/behat/app_basic_usage.feature | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100755 mod/comments/tests/behat/app_basic_usage.feature diff --git a/mod/comments/tests/behat/app_basic_usage.feature b/mod/comments/tests/behat/app_basic_usage.feature new file mode 100755 index 000000000..6b7ae1e64 --- /dev/null +++ b/mod/comments/tests/behat/app_basic_usage.feature @@ -0,0 +1,155 @@ +@mod @mod_comments @app @javascript +Feature: Test basic usage of comments in app + In order to participate in the comments while using the mobile app + As a student + I need basic comments functionality to work + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | teacher | teacher1@example.com | + | student1 | Student | student | student1@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 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | mainglossary | allowcomments | assessed | scale | + | glossary | Test glossary | glossary description | C1 | gloss1 | 1 | 1 | 1 | 1 | + + And the following "activities" exist: + | activity | name | intro | course | idnumber | comments | + | data | Data | Data info | C1 | data1 | 1 | + + + @app @3.8.0 @OK + Scenario: Add comments and delete comments (database) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Data" in the app + And I press "Display options" 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 add a "Text input" field to "Data" database and I fill the form with: + | Field name | Test field name | + | Field description | Test field description | + And I press "Save" + And I close the browser tab opened by the app + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Data" in the app + And I press "add" in the app + And I set the field "Test field name" to "Test" in the app + And I press "Save" in the app + And I press "More" in the app + And I press "Comments (0)" in the app + And I press "close" in the app + And I set the field "Add a comment..." to "comment test" in the app + And I press "Save comment" in the app + Then I should see "Comment created" + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Data" in the app + And I press "More" in the app + And I press "Comments (1)" in the app + And I press "close" in the app + And I set the field "Add a comment..." to "comment test student" in the app + And I press "Save comment" in the app + Then I should see "Comment created" + And I should see "comment test" + And I should see "comment test student" + And I press the back button in the app + And I should see "Comments (2)" + And I press "Comments (2)" in the app + And I press "Delete" in the app + And I press "trash" in the app + And I press "Delete" near "Cancel" in the app + Then I should see "Comment deleted" + And I should see "comment test" + And I should not see "comment test student" + And I press the back button in the app + And I should see "Comments (1)" + + @app @3.8.0 @OK + Scenario: Add comments offline, delete comments offline and sync (database) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Data" in the app + And I press "Display options" 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 add a "Text input" field to "Data" database and I fill the form with: + | Field name | Test field name | + | Field description | Test field description | + And I press "Save" + And I close the browser tab opened by the app + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Data" in the app + And I press "add" in the app + And I set the field "Test field name" to "Test" in the app + And I press "Save" in the app + And I press "More" in the app + And I press "Comments (0)" in the app + And I switch offline mode to "true" + And I press "close" in the app + And I set the field "Add a comment..." to "comment test" in the app + And I press "Save comment" in the app + Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later." + And I should see "There are offline comments to be synchronised." + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (0)" + And I press "Comments (0)" in the app + And I switch offline mode to "false" + And I press "Display options" in the app + And I press "Synchronise now" in the app + Then I should not see "There are offline comments to be synchronised." + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + And I press "Comments (1)" in the app + And I switch offline mode to "true" + And I press "Delete" in the app + And I press "trash" in the app + And I press "Delete" near "Cancel" in the app + Then I should see "Comment deleted" + And I should see "There are offline comments to be synchronised." + And I should see "Deleted offline" + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + And I press "Comments (1)" in the app + And I switch offline mode to "false" + And I press "Display options" in the app + And I press "Synchronise now" in the app + Then I should not see "There are offline comments to be synchronised." + And I should not see "comment test" + And I press the back button in the app + And I should see "Comments (0)" \ No newline at end of file From 039e9d6e10f26e4566fe3bf9cf20a109cf7e7508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 13 Feb 2020 10:53:27 +0100 Subject: [PATCH 48/61] MOBILE-3342 behat: Behat basic test for comments --- .../tests/behat/app_basic_usage.feature | 342 ++++++++++++++++++ 1 file changed, 342 insertions(+) diff --git a/mod/comments/tests/behat/app_basic_usage.feature b/mod/comments/tests/behat/app_basic_usage.feature index 6b7ae1e64..1971374f4 100755 --- a/mod/comments/tests/behat/app_basic_usage.feature +++ b/mod/comments/tests/behat/app_basic_usage.feature @@ -152,4 +152,346 @@ Feature: Test basic usage of comments in app Then I should not see "There are offline comments to be synchronised." And I should not see "comment test" And I press the back button in the app + And I should see "Comments (0)" + + @app @3.8.0 @OK + Scenario: Add comments and delete comments (glossary) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "Save" in the app + And I press "potato" in the app + And I press "Comments (0)" in the app + And I press "close" in the app + And I set the field "Add a comment..." to "comment test" in the app + And I press "Save comment" in the app + Then I should see "Comment created" + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Test glossary" in the app + And I press "potato" in the app + And I press "Comments (1)" in the app + And I press "close" in the app + And I set the field "Add a comment..." to "comment test student" in the app + And I press "Save comment" in the app + Then I should see "Comment created" + And I should see "comment test" + And I should see "comment test student" + And I press the back button in the app + And I should see "Comments (2)" + And I press "Comments (2)" in the app + And I press "Delete" in the app + And I press "trash" in the app + And I press "Delete" near "Cancel" in the app + Then I should see "Comment deleted" + And I should see "comment test" + And I should not see "comment test student" + And I press the back button in the app + And I should see "Comments (1)" + + @app @3.8.0 @OK + Scenario: Add comments offline, delete comments offline and sync (glossary) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "Save" in the app + And I press "potato" in the app + And I press "Comments (0)" in the app + And I switch offline mode to "true" + And I press "close" in the app + And I set the field "Add a comment..." to "comment test" in the app + And I press "Save comment" in the app + Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later." + And I should see "There are offline comments to be synchronised." + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (0)" + And I press "Comments (0)" in the app + And I switch offline mode to "false" + And I press "Display options" in the app + And I press "Synchronise now" in the app + Then I should not see "There are offline comments to be synchronised." + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + And I press "Comments (1)" in the app + And I switch offline mode to "true" + And I press "Delete" in the app + And I press "trash" in the app + And I press "Delete" near "Cancel" in the app + Then I should see "Comment deleted" + And I should see "There are offline comments to be synchronised." + And I should see "Deleted offline" + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + And I press "Comments (1)" in the app + And I switch offline mode to "false" + And I press "Display options" in the app + And I press "Synchronise now" in the app + Then I should not see "There are offline comments to be synchronised." + And I should not see "comment test" + And I press the back button in the app + And I should see "Comments (0)" + + @app @3.8.0 @mobile @OK + Scenario: Add comments and delete comments mobile (blogs) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "menu" in the app + And I press "Website" in the app + And I switch to the browser tab opened by the app + And I follow "Log in" + And I log in as "teacher1" + And I click on "Side panel" "button" + And I follow "C1" + And I press "Actions menu" + And I follow "Turn editing on" + And I click on "Side panel" "button" + And I follow "Add a block" + And I follow "Blog menu" + And I follow "Add an entry about this course" + And I set the field "Entry title" to "Blog test" + And I set the field "Blog entry body" to "Blog body" + And I press "Save changes" + And I close the browser tab opened by the app + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "menu" in the app + And I press "Site blog" in the app + Then I should see "Blog test" + And I should see "Blog body" + And I should see "Comments (0)" + And I press "Comments (0)" in the app + And I press "close" in the app + And I set the field "Add a comment..." to "comment test" in the app + And I press "Save comment" in the app + Then I should see "Comment created" + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + And I press "Comments (1)" in the app + And I press "Delete" in the app + And I press "trash" in the app + And I press "Delete" near "Cancel" in the app + Then I should see "Comment deleted" + And I should not see "comment test" + And I press the back button in the app + And I should see "Comments (0)" + + @app @3.8.0 @tablet @OK + Scenario: Add comments and delete comments tablet (blogs) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "menu" in the app + And I press "Website" in the app + And I switch to the browser tab opened by the app + And I follow "Log in" + And I log in as "teacher1" + And I follow "C1" + And I press "Actions menu" + And I follow "Turn editing on" + And I follow "Add a block" + And I follow "Blog menu" + And I follow "Add an entry about this course" + And I set the field "Entry title" to "Blog test" + And I set the field "Blog entry body" to "Blog body" + And I press "Save changes" + And I close the browser tab opened by the app + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Site blog" in the app + Then I should see "Blog test" + And I should see "Blog body" + And I should see "Comments (0)" + And I press "Comments (0)" in the app + And I press "close" in the app + And I set the field "Add a comment..." to "comment test" in the app + And I press "Save comment" in the app + Then I should see "Comment created" + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + And I press "Comments (1)" in the app + And I press "Delete" in the app + And I press "trash" in the app + And I press "Delete" near "Cancel" in the app + Then I should see "Comment deleted" + And I should not see "comment test" + And I press the back button in the app + And I should see "Comments (0)" + + @app @3.8.0 @mobile @OK + Scenario: Add comments offline, delete comments offline and sync mobile (blogs) + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "menu" in the app + And I press "Website" in the app + And I switch to the browser tab opened by the app + And I follow "Log in" + And I log in as "teacher1" + And I click on "Side panel" "button" + And I follow "C1" + And I press "Actions menu" + And I follow "Turn editing on" + And I click on "Side panel" "button" + And I follow "Add a block" + And I follow "Blog menu" + And I follow "Add an entry about this course" + And I set the field "Entry title" to "Blog test" + And I set the field "Blog entry body" to "Blog body" + And I press "Save changes" + And I close the browser tab opened by the app + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "menu" in the app + And I press "Site blog" in the app + Then I should see "Blog test" + And I should see "Blog body" + And I should see "Comments (0)" + And I press "Comments (0)" in the app + And I switch offline mode to "true" + And I press "close" in the app + And I set the field "Add a comment..." to "comment test" in the app + And I press "Save comment" in the app + Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later." + And I should see "There are offline comments to be synchronised." + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (0)" + And I press "Comments (0)" in the app + And I switch offline mode to "false" + And I press "Display options" in the app + And I press "Synchronise now" in the app + Then I should not see "There are offline comments to be synchronised." + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + And I press "Comments (1)" in the app + And I switch offline mode to "true" + And I press "Delete" in the app + And I press "trash" in the app + And I press "Delete" near "Cancel" in the app + Then I should see "Comment deleted" + And I should see "There are offline comments to be synchronised." + And I should see "Deleted offline" + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + And I press "Comments (1)" in the app + And I switch offline mode to "false" + And I press "Display options" in the app + And I press "Synchronise now" in the app + Then I should not see "There are offline comments to be synchronised." + And I should not see "comment test" + And I press the back button in the app + And I should see "Comments (0)" + + @app @3.8.0 @tablet @OK + Scenario: Add comments offline, delete comments offline and sync tablet (blogs) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "menu" in the app + And I press "Website" in the app + And I switch to the browser tab opened by the app + And I follow "Log in" + And I log in as "teacher1" + And I follow "C1" + And I press "Actions menu" + And I follow "Turn editing on" + And I follow "Add a block" + And I follow "Blog menu" + And I follow "Add an entry about this course" + And I set the field "Entry title" to "Blog test" + And I set the field "Blog entry body" to "Blog body" + And I press "Save changes" + And I close the browser tab opened by the app + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Site blog" in the app + Then I should see "Blog test" + And I should see "Blog body" + And I should see "Comments (0)" + And I press "Comments (0)" in the app + And I switch offline mode to "true" + And I press "close" in the app + And I set the field "Add a comment..." to "comment test" in the app + And I press "Save comment" in the app + Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later." + And I should see "There are offline comments to be synchronised." + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (0)" + And I press "Comments (0)" in the app + And I switch offline mode to "false" + And I press "Display options" in the app + And I press "Synchronise now" in the app + Then I should not see "There are offline comments to be synchronised." + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + And I press "Comments (1)" in the app + And I switch offline mode to "true" + And I press "Delete" in the app + And I press "trash" in the app + And I press "Delete" near "Cancel" in the app + Then I should see "Comment deleted" + And I should see "There are offline comments to be synchronised." + And I should see "Deleted offline" + And I should see "comment test" + And I press the back button in the app + And I should see "Comments (1)" + And I press "Comments (1)" in the app + And I switch offline mode to "false" + And I press "Display options" in the app + And I press "Synchronise now" in the app + Then I should not see "There are offline comments to be synchronised." + And I should not see "comment test" + And I press the back button in the app And I should see "Comments (0)" \ No newline at end of file From 31c8a79d0f3851d2b34b9352b1368d38180e8e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 13 Feb 2020 12:11:25 +0100 Subject: [PATCH 49/61] MOBILE-3328 behat: Behat basic test for glossary --- .../tests/behat/app_basic_usage.feature | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index 43e8ec9bd..285b878bb 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -95,6 +95,50 @@ Feature: Test basic usage of glossary in app Then I should see "potato" And I should see "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." + @app @3.8.0 @OK + Scenario: Navigate to glossary terms by link (auto-linking) + And the "glossary" filter is "on" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "This entry should be automatically linked" in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "car" in the app + And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app + And I press "This entry should be automatically linked" in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "mountain" in the app + And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app + And I press "This entry should be automatically linked" in the app + And I press "Save" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + And I press the back button in the app + And I press "Test forum name" in the app + And I press "add" in the app + And I set the field "Subject" to "Testing auto-link glossary" + And I set the field "Message" to "Glossary terms auto-linked: potato car mountain" in the app + And I press "Post to forum" in the app + And I press "Testing auto-link glossary" near "Last post a few seconds ago" in the app + And I press "car" in the app + Then the header should be "car" in the app + And I should see "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." + And I press the back button in the app + And I press "mountain" in the app + Then the header should be "mountain" in the app + And I should see "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." + @app @3.8.0 @OK Scenario: See comments When I enter the app From bb9f2eb1cd69206f9a0a8beed5043d9239fa564c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Tue, 18 Feb 2020 10:18:56 +0100 Subject: [PATCH 50/61] MOBILE-3352 behat: Behat basic test for assignment --- .../tests/behat/app_basic_usage.feature | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 mod/assignment/tests/behat/app_basic_usage.feature diff --git a/mod/assignment/tests/behat/app_basic_usage.feature b/mod/assignment/tests/behat/app_basic_usage.feature new file mode 100755 index 000000000..73ff1988b --- /dev/null +++ b/mod/assignment/tests/behat/app_basic_usage.feature @@ -0,0 +1,63 @@ +@mod @mod_assign @app @javascript +Feature: Test basic usage of assignment activity in app + In order to participate in the assignment while using the mobile app + I need basic assignment functionality to work + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | teacher | teacher1@example.com | + | student1 | Student | student | student1@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 | + And the following "activities" exist: + | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | + | assign | C1 | assign1 | assignment1 | Test assignment description1 | 1 | 1 | + + + @app @3.8.0 @OK + Scenario: View assign and add a submission (online text), view own submission or student submission and view list of student submissions (as teacher) + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "assignment1" in the app + Then the header should be "assignment1" in the app + And I should see "Test assignment description1" + And I should see "Due date" + And I should see "Thursday, 1 January 1970, 1:00 AM" + And I press "Add submission" in the app + And I set the field "Online text submissions" to "Submission test" in the app + And I press "Save" in the app + Then I should see "Draft (not submitted)" + And I should see "Not graded" + And I press "Edit submission" in the app + And I set the field "Online text submissions" to "Submission test edited" in the app + And I press "Save" in the app + And I press "OK" in the app + And I press "Submit assignment" in the app + And I press "OK" in the app + Then I should see "Submitted for grading" + And I should see "Not graded" + And I should see "Submission test edited" + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "assignment1" in the app + Then the header should be "assignment1" in the app + And I press "Submitted" in the app + Then I should see "Student student" + And I should see "Not graded" + And I press "Student student" near "assignment1" in the app + Then I should see "Online text submission" + And I should see "Submission test edited" \ No newline at end of file From 9f3160f9700e827b97ade948267f52bb7720d8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 20 Feb 2020 09:23:51 +0100 Subject: [PATCH 51/61] MOBILE-3352 behat: Behat basic test for assignment --- .../tests/behat/app_basic_usage.feature | 79 ++++++++++++++++++- 1 file changed, 75 insertions(+), 4 deletions(-) diff --git a/mod/assignment/tests/behat/app_basic_usage.feature b/mod/assignment/tests/behat/app_basic_usage.feature index 73ff1988b..a858bb185 100755 --- a/mod/assignment/tests/behat/app_basic_usage.feature +++ b/mod/assignment/tests/behat/app_basic_usage.feature @@ -16,12 +16,12 @@ Feature: Test basic usage of assignment activity in app | teacher1 | C1 | editingteacher | | student1 | C1 | student | And the following "activities" exist: - | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | - | assign | C1 | assign1 | assignment1 | Test assignment description1 | 1 | 1 | + | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | attemptreopenmethod | + | assign | C1 | assign1 | assignment1 | Test assignment description1 | 1 | 1 | manual | @app @3.8.0 @OK - Scenario: View assign and add a submission (online text), view own submission or student submission and view list of student submissions (as teacher) + Scenario: View assign and add a submission (online text), submit for grading, view own submission or student submission and view list of student submissions (as teacher) When I enter the app And I log in as "student1" Then the header should be "Acceptance test site" in the app @@ -60,4 +60,75 @@ Feature: Test basic usage of assignment activity in app And I should see "Not graded" And I press "Student student" near "assignment1" in the app Then I should see "Online text submission" - And I should see "Submission test edited" \ No newline at end of file + And I should see "Submission test edited" + + @app @3.8.0 @OK + Scenario: Add new attempt from previous submission + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "assignment1" in the app + Then the header should be "assignment1" in the app + And I should see "Test assignment description1" + And I should see "Due date" + And I should see "Thursday, 1 January 1970, 1:00 AM" + And I press "Add submission" in the app + And I set the field "Online text submissions" to "Submission test" in the app + And I press "Save" in the app + And I press "Submit assignment" in the app + And I press "OK" in the app + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "assignment1" in the app + Then the header should be "assignment1" in the app + And I press "Participants" in the app + Then I should see "Student student" + And I should see "Not graded" + And I press "Student student" near "assignment1" in the app + Then I should see "Online text submission" + And I should see "Submission test" + And I press "Grade" in the app + And I press "Allow another attempt" in the app + And I press "Done" + Then I should see "Reopened" + And I should see "Not graded" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "assignment1" in the app + And I should see "Reopened" + And I should see "2 out of Unlimited" + And I should see "Add a new attempt based on previous submission" + And I should see "Add a new attempt" + And I press "Add a new attempt based on previous submission" in the app + And I press "OK" in the app + Then I should see "Submission test" + And I set the field "Online text submissions" to "Submission test 2 attempt" in the app + And I press "Save" in the app + And I press "OK" in the app + And I press "Submit assignment" in the app + And I press "OK" in the app + When I enter the app + And I log in as "teacher1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "assignment1" in the app + Then the header should be "assignment1" in the app + And I press "Participants" in the app + Then I should see "Student student" + And I should see "Not graded" + And I press "Student student" near "assignment1" in the app + Then I should see "Online text submission" + And I should see "Submission test 2 attempt" \ No newline at end of file From a9e0677dbd8c0290e3ab5d9da5ee9073bd290df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 20 Feb 2020 09:51:56 +0100 Subject: [PATCH 52/61] MOBILE-3352 behat: Behat basic test for assignment --- .../tests/behat/app_basic_usage.feature | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/mod/assignment/tests/behat/app_basic_usage.feature b/mod/assignment/tests/behat/app_basic_usage.feature index a858bb185..ca6a5f23a 100755 --- a/mod/assignment/tests/behat/app_basic_usage.feature +++ b/mod/assignment/tests/behat/app_basic_usage.feature @@ -131,4 +131,30 @@ Feature: Test basic usage of assignment activity in app And I should see "Not graded" And I press "Student student" near "assignment1" in the app Then I should see "Online text submission" - And I should see "Submission test 2 attempt" \ No newline at end of file + And I should see "Submission test 2 attempt" + + @app @3.8.0 @OK + Scenario: Add submission offline (online text) + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "assignment1" in the app + Then the header should be "assignment1" in the app + And I should see "Test assignment description1" + And I should see "Due date" + And I should see "Thursday, 1 January 1970, 1:00 AM" + And I press "Add submission" in the app + And I switch offline mode to "true" + And I set the field "Online text submissions" to "Submission test" in the app + And I press "Save" in the app + And I press "Submit assignment" in the app + And I press "OK" in the app + Then I should see "This Assignment has offline data to be synchronised." + And I switch offline mode to "false" + And I press the back button in the app + And I press "assignment1" in the app + Then I should not see "This Assignment has offline data to be synchronised." + And I should see "Submitted for grading" \ No newline at end of file From 0b8fc262ba0815c97c2db4f666be152fd25403b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 20 Feb 2020 10:19:44 +0100 Subject: [PATCH 53/61] MOBILE-3352 behat: Behat basic test for assignment --- .../tests/behat/app_basic_usage.feature | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/mod/assignment/tests/behat/app_basic_usage.feature b/mod/assignment/tests/behat/app_basic_usage.feature index ca6a5f23a..8bc5c0a1d 100755 --- a/mod/assignment/tests/behat/app_basic_usage.feature +++ b/mod/assignment/tests/behat/app_basic_usage.feature @@ -157,4 +157,39 @@ Feature: Test basic usage of assignment activity in app And I press the back button in the app And I press "assignment1" in the app Then I should not see "This Assignment has offline data to be synchronised." - And I should see "Submitted for grading" \ No newline at end of file + And I should see "Submitted for grading" + + @app @3.8.0 @OK + Scenario: Edit an offline submission before synchronizing it + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "assignment1" in the app + Then the header should be "assignment1" in the app + And I should see "Test assignment description1" + And I should see "Due date" + And I should see "Thursday, 1 January 1970, 1:00 AM" + And I press "Add submission" in the app + And I switch offline mode to "true" + And I set the field "Online text submissions" to "Submission test1" in the app + And I press "Save" in the app + Then I should see "This Assignment has offline data to be synchronised." + And I should see "Submission test1" + And I press "Edit submission" in the app + And I set the field "Online text submissions" to "Submission test edited offline" in the app + And I press "Save" in the app + Then I should see "This Assignment has offline data to be synchronised." + And I should not see "Submission test1" + And I should see "Submission test edited offline" + And I press "Submit assignment" in the app + And I press "OK" in the app + Then I should see "This Assignment has offline data to be synchronised." + And I switch offline mode to "false" + And I press the back button in the app + And I press "assignment1" in the app + Then I should not see "This Assignment has offline data to be synchronised." + And I should see "Submitted for grading" + And I should see "Submission test edited offline" \ No newline at end of file From bb3d7e8046f0bf07dbcb17248cb11992224ff189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 20 Feb 2020 10:38:18 +0100 Subject: [PATCH 54/61] MOBILE-3352 behat: Behat basic test for assignment --- mod/assignment/tests/behat/app_basic_usage.feature | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/assignment/tests/behat/app_basic_usage.feature b/mod/assignment/tests/behat/app_basic_usage.feature index 8bc5c0a1d..eaf010553 100755 --- a/mod/assignment/tests/behat/app_basic_usage.feature +++ b/mod/assignment/tests/behat/app_basic_usage.feature @@ -134,7 +134,7 @@ Feature: Test basic usage of assignment activity in app And I should see "Submission test 2 attempt" @app @3.8.0 @OK - Scenario: Add submission offline (online text) + Scenario: Add submission offline (online text), submit for grading offline and sync submissions When I enter the app And I log in as "student1" Then the header should be "Acceptance test site" in the app @@ -156,6 +156,8 @@ Feature: Test basic usage of assignment activity in app And I switch offline mode to "false" And I press the back button in the app And I press "assignment1" in the app + And I press "Display options" in the app + And I press "Refresh" in the app Then I should not see "This Assignment has offline data to be synchronised." And I should see "Submitted for grading" From bc261f9062cd56de3249066e8341ed89c1c85a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 24 Feb 2020 09:32:08 +0100 Subject: [PATCH 55/61] MOBILE-3353 behat: Behat basic test for quiz --- mod/quiz/tests/behat/app_basic_usage.feature | 135 +++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100755 mod/quiz/tests/behat/app_basic_usage.feature diff --git a/mod/quiz/tests/behat/app_basic_usage.feature b/mod/quiz/tests/behat/app_basic_usage.feature new file mode 100755 index 000000000..9e0a07911 --- /dev/null +++ b/mod/quiz/tests/behat/app_basic_usage.feature @@ -0,0 +1,135 @@ +@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 | + | 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 | Text of the fifth question | + | Test questions | truefalse | TF8 | Text of the sixth question | + | Test questions | match | TF9 | Text of the seventh question | + And quiz "Quiz 2" contains the following questions: + | question | page | + | TF3 | 1 | + | TF4 | 2 | + | TF5 | 3 | + | TF6 | 4 | + | TF7 | 5 | + | TF8 | 6 | + | TF9 | 7 | + + + @app @3.8.0 @OK + Scenario: View a quiz entry page (attempts, status, etc.) + 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 "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 + Then 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 + Then I should see "Review of attempt 1" + And I should see "Started on" + And I should see "State" + And I should see "Completed on" + And I should see "Time taken" + And I should see "Marks" + And I should see "Grade" + And I should see "Question 1" + And I should see "Question 2" + + @app @3.8.0 @OK + Scenario: Attempt a quiz (all question types) + 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 "Quiz 2" in the 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" near "Question 1" in the app + And I set the field "Answer" to "testing" 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" near "Question 3" in the app + And I set the field "Answer" to "Testing an essay" in the app + And I press "Next" near "Question 4" in the app + And I press "lazy" in the app + And I press "Next" near "Question 5" in the app + And I press "True" in the app + And I press "Next" near "Question 6" in the app + And I press "Choose..." near "frog" in the app + And I press "amphibian" in the app + And I press "Choose..." near "newt" in the app + And I press "insect" in the app + And I press "Choose..." near "cat" in the app + And I press "mammal" in the app + And I press "Next" near "Question 7" in the app + And I press "Submit all and finish" in the app + And I press "OK" in the app + Then I should see "Review of attempt 1" + And I should see "Finished" + And I should see "Not yet graded" \ No newline at end of file From 6442bb26c3bad89316ace3f58eb6c9058ef00a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 24 Feb 2020 10:13:51 +0100 Subject: [PATCH 56/61] MOBILE-3353 behat: Behat basic test for quiz --- mod/quiz/tests/behat/app_basic_usage.feature | 30 +++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/mod/quiz/tests/behat/app_basic_usage.feature b/mod/quiz/tests/behat/app_basic_usage.feature index 9e0a07911..6789cfdd9 100755 --- a/mod/quiz/tests/behat/app_basic_usage.feature +++ b/mod/quiz/tests/behat/app_basic_usage.feature @@ -132,4 +132,32 @@ Feature: Attempt a quiz in app And I press "OK" in the app Then I should see "Review of attempt 1" And I should see "Finished" - And I should see "Not yet graded" \ No newline at end of file + And I should see "Not yet graded" + + @app @3.8.0 @OK + Scenario: Submit a quiz and review a quiz attempt + 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 "Quiz 1" in the app + And I press "Attempt quiz now" in the 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 all and finish" in the app + And I press "OK" in the app + Then I should see "Review of attempt 1" + When I enter the app + And I log in as "teacher1" + And I press "Course 1" near "Course overview" in the app + And I press "Quiz 1" in the app + And I press "Display options" 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 follow "Attempts: 1" + And I follow "Review attempt" + Then I should see "Finished" + And I should see "1.00/2.00" + And I close the browser tab opened by the app \ No newline at end of file From 0083a401cd858c2fada3e1715b8aa2fbf02c8029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Thu, 27 Feb 2020 11:41:03 +0100 Subject: [PATCH 57/61] MOBILE-3362 behat: Behat basic test for chat --- mod/chat/tests/behat/app_basic_usage.feature | 74 ++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 mod/chat/tests/behat/app_basic_usage.feature diff --git a/mod/chat/tests/behat/app_basic_usage.feature b/mod/chat/tests/behat/app_basic_usage.feature new file mode 100755 index 000000000..dc0c1184c --- /dev/null +++ b/mod/chat/tests/behat/app_basic_usage.feature @@ -0,0 +1,74 @@ +@mod @mod_chat @app @javascript +Feature: Test basic usage of chat in app + As a student + I need basic chat functionality to work + + Background: + Given the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "users" exist: + | username | firstname | lastname | + | student1 | david | student | + | student2 | pau | student2 | + | teacher1 | juan | teacher | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + | student2 | C1 | student | + | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | chat | Test chat name | Test chat | C1 | chat | 0 | + + @app @3.8.0 @OK + Scenario: Receive and send messages, see connected users, beep and talk to + 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 chat name" in the app + Then I should see "Click here to enter the chat now" + And I should see "View past chat sessions" + And I press "Click here to enter the chat now" in the app + And I set the field "New message" to "Hi!" + And I press "Send" in the app + And I set the field "New message" to "I am David" + And I press "Send" in the app + When I enter the app + And I log in as "student2" + And I press "Course 1" near "Course overview" in the app + And I press "Test chat name" in the app + And I press "Click here to enter the chat now" in the app + Then I should see "Hi!" + And I should see "I am David" + And I press "people" in the app + Then I should see "david student" + And I press "Beep" in the app + Then I should see "You beeped david student" + And I set the field "New message" to "Hi David, I am Pau." + And I press "Send" in the app + + @app @3.8.0 @OK + Scenario: Past sessions shown for >=3.5 + 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 chat name" in the app + Then I should see "Click here to enter the chat now" + And I should see "View past chat sessions" + And I press "Click here to enter the chat now" in the app + And I set the field "New message" to "Hi!" + And I press "Send" in the app + And I set the field "New message" to "I am David" + And I press "Send" in the app + When I enter the app + And I log in as "student2" + And I press "Course 1" near "Course overview" in the app + And I press "Test chat name" in the app + Then I should see "Click here to enter the chat now" + And I should see "View past chat sessions" + And I press "View past chat sessions" in the app + And I press "Show incomplete sessions" in the app + And I press "david student (2)" in the app + Then I should see "Hi!" + And I should see "I am David" \ No newline at end of file From 7325109de6f84302b9e6eaa75f09742498fa9a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 2 Mar 2020 10:46:24 +0100 Subject: [PATCH 58/61] MOBILE-3372 behat: Behat basic test for login --- mod/login/tests/behat/app_basic_usage.feature | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 mod/login/tests/behat/app_basic_usage.feature diff --git a/mod/login/tests/behat/app_basic_usage.feature b/mod/login/tests/behat/app_basic_usage.feature new file mode 100755 index 000000000..445045ba7 --- /dev/null +++ b/mod/login/tests/behat/app_basic_usage.feature @@ -0,0 +1,108 @@ +@mod @mod_login @app @javascript +Feature: Test basic usage of login in app + I need basic login functionality to work + + Background: + Given the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "users" exist: + | username | firstname | lastname | + | student1 | david | student | + | student2 | pau | student2 | + | teacher1 | juan | teacher | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + | student2 | C1 | student | + | teacher1 | C1 | editingteacher | + + @app @3.8.0 @OK + Scenario: Add a non existing site + When I enter the app + And I log in as "student1" + And I press "menu" in the app + And I press "Change site" in the app + And I press "add" in the app + And I set the field "Site address" to "Wrong Site Address" in the app + And I press "Connect!" in the app + Then I should see "Error" + And I should see "Double check you've entered the address correctly and try again." + + @app @3.8.0 @OK + Scenario: Delete a site + When I enter the app + And I log in as "student1" + And I press "menu" in the app + And I press "Change site" in the app + Then I should see "Acceptance test site" + And I press "Delete" in the app + And I press "trash" in the app + And I press "Delete" in the app + Then I should not see "Acceptance test site" + And I should see "Connect to Moodle" + + @app @3.8.0 @mobile @OK + Scenario: Require minium version of the app for a site and site name in displayed when adding a new site (mobile) + When I enter the app + Then I should see "Acceptance test site" + And I log in as "teacher1" + And I press "menu" in the app + And I press "Website" in the app + And I switch to the browser tab opened by the app + And I follow "Log in" + And I log in as "admin" + And I press "Side panel" + And I follow "Site administration" + And I follow "Mobile authentication" + And I set the field "Minimum app version required" to "3.8.1" + And I press "Save changes" + And I close the browser tab opened by the app + When I enter the app + And I log in as "teacher1" + And I press "menu" in the app + And I press "Website" in the app + And I switch to the browser tab opened by the app + And I follow "Log in" + And I log in as "admin" + And I press "Side panel" + And I follow "Site administration" + And I follow "Mobile authentication" + And I set the field "Minimum app version required" to "3.8.2" + And I press "Save changes" + And I close the browser tab opened by the app + When I enter the app + Then I should see "App update required" + + @app @3.8.0 @tablet @OK + Scenario: Require minium version of the app for a site and site name in displayed when adding a new site (tablet) + When I enter the app + And I change viewport size to "1280x1080" + Then I should see "Acceptance test site" + And I log in as "teacher1" + And I press "menu" in the app + And I press "Website" in the app + And I switch to the browser tab opened by the app + And I follow "Log in" + And I log in as "admin" + And I follow "Site administration" + And I follow "Mobile authentication" + And I set the field "Minimum app version required" to "3.8.1" + And I press "Save changes" + And I close the browser tab opened by the app + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "teacher1" + And I press "menu" in the app + And I press "Website" in the app + And I switch to the browser tab opened by the app + And I follow "Log in" + And I log in as "admin" + And I follow "Site administration" + And I follow "Mobile authentication" + And I set the field "Minimum app version required" to "3.8.2" + And I press "Save changes" + And I close the browser tab opened by the app + When I enter the app + And I change viewport size to "1280x1080" + Then I should see "App update required" \ No newline at end of file From c0506d6ff0d99ba262efa623d5c218b44f182334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Wed, 4 Mar 2020 11:19:27 +0100 Subject: [PATCH 59/61] Fix on course and glossary behats --- mod/course/tests/behat/app_basic_usage.feature | 4 ++-- mod/glossary/tests/behat/app_basic_usage.feature | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mod/course/tests/behat/app_basic_usage.feature b/mod/course/tests/behat/app_basic_usage.feature index a42f3154b..c661d8822 100755 --- a/mod/course/tests/behat/app_basic_usage.feature +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -495,7 +495,7 @@ Feature: Test basic usage of one course in app And I click on "Side panel" "button" And I follow "Add a block" And I follow "Activities" - And I click on "Actions menu" "icon" in the "#dropdown-0" "css_element" + And I click on "Actions menu" "icon" in the "#action-menu-toggle-0" "css_element" And I follow "Configure (new HTML block) block" And I set the field "HTML block title" to "HTML title test" And I set the field "Content" to "body test" @@ -544,7 +544,7 @@ Feature: Test basic usage of one course in app And I follow "HTML" And I follow "Add a block" And I follow "Activities" - And I click on "Actions menu" "icon" in the "#dropdown-0" "css_element" + And I click on "Actions menu" "icon" in the "#action-menu-toggle-0" "css_element" And I follow "Configure (new HTML block) block" And I set the field "HTML block title" to "HTML title test" And I set the field "Content" to "body test" diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index 285b878bb..3fedced35 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -83,15 +83,14 @@ Feature: Test basic usage of glossary in app And I should see "car" And I should see "mountain" And I should see "potato" - And I press "Browse entries" in the app And I press "Search" in the app And I set the field "Search query" to "something" in the app - And I press "search" in the app + And I press "search" near "No entries were found." in the app Then I should see "No entries were found." And I set the field "Search query" to "potato" in the app - And I press "search" in the app + And I press "search" near "No entries were found." in the app And I set the field "Search query" to " " in the app - And I press "potato" in the app + And I press "potato" near "glossary description" in the app Then I should see "potato" And I should see "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." From 154c0fbefd01de7b5132335d8c8ac077fff44f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 9 Mar 2020 09:35:47 +0100 Subject: [PATCH 60/61] Fixes on: MOBILE-3328, glossary --- .../tests/behat/app_basic_usage.feature | 42 +++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index 3fedced35..f600e97fd 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -58,8 +58,8 @@ Feature: Test basic usage of glossary in app Then I should see "car" And I should see "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." - @app @3.8.0 @OK - Scenario: Change filters (include search) + @app @3.8.0 @mobile @OK + Scenario: Change filters (include search) (mobile) When I enter the app And I log in as "student1" Then the header should be "Acceptance test site" in the app @@ -90,7 +90,43 @@ Feature: Test basic usage of glossary in app And I set the field "Search query" to "potato" in the app And I press "search" near "No entries were found." in the app And I set the field "Search query" to " " in the app - And I press "potato" near "glossary description" in the app + And I press "potato" near "something" in the app + And I press "potato" in the app + Then I should see "potato" + And I should see "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." + + @app @3.8.0 @tablet @OK + Scenario: Change filters (include search) (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + Then the header should be "Course 1" in the app + And I press "Test glossary" in the app + And I press "close" in the app + And I set the field "Concept" to "potato" in the app + And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "car" in the app + And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app + And I press "Save" in the app + And I press "close" in the app + And I set the field "Concept" to "mountain" in the app + And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app + And I press "Save" in the app + Then the header should be "Test glossary" in the app + And I should see "car" + And I should see "mountain" + And I should see "potato" + And I press "Search" in the app + And I set the field "Search query" to "something" in the app + And I press "search" near "No entries were found." in the app + Then I should see "No entries were found." + And I set the field "Search query" to "potato" in the app + And I press "search" near "No entries were found." in the app Then I should see "potato" And I should see "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." From e507dd4131f3a2721be13ee4d95febb4be30a67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Mon, 9 Mar 2020 11:55:56 +0100 Subject: [PATCH 61/61] Fixes on: MOBILE-3328, glossary --- mod/glossary/tests/behat/app_basic_usage.feature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index f600e97fd..67784dc39 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -90,7 +90,8 @@ Feature: Test basic usage of glossary in app And I set the field "Search query" to "potato" in the app And I press "search" near "No entries were found." in the app And I set the field "Search query" to " " in the app - And I press "potato" near "something" in the app + And I press "Display options" in the app + And I press "Refresh" in the app And I press "potato" in the app Then I should see "potato" And I should see "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae."