From 4452bd58751e8aab8f1f0049793e9b7fe268ffd2 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 20 Dec 2021 17:35:26 +0100 Subject: [PATCH] MOBILE-3833 behat: Simplify entering the app --- .../tests/behat/app_basic_usage.feature | 32 +++------- mod/chat/tests/behat/app_basic_usage.feature | 16 ++--- .../tests/behat/app_basic_usage.feature | 28 +++------ .../tests/behat/app_basic_usage.feature | 48 ++++----------- .../tests/behat/app_basic_usage.feature | 24 ++------ .../tests/behat/app_course_completion.feature | 4 +- mod/data/tests/behat/app_data_entries.feature | 32 +++------- mod/data/tests/behat/app_data_sync.feature | 12 +--- mod/forum/tests/behat/app_basic_usage.feature | 60 +++++-------------- .../tests/behat/app_basic_usage.feature | 48 ++++----------- .../tests/behat/app_basic_usage.feature | 20 ++----- mod/quiz/tests/behat/app_basic_usage.feature | 16 ++--- .../tests/behat/app_basic_usage.feature | 28 +++------ tests/behat/navigation_activities.feature | 4 +- tests/behat/navigation_externallinks.feature | 4 +- tests/behat/navigation_gestures.feature | 8 +-- 16 files changed, 96 insertions(+), 288 deletions(-) diff --git a/mod/assignment/tests/behat/app_basic_usage.feature b/mod/assignment/tests/behat/app_basic_usage.feature index 1c4fd025d..e3b536b98 100755 --- a/mod/assignment/tests/behat/app_basic_usage.feature +++ b/mod/assignment/tests/behat/app_basic_usage.feature @@ -21,9 +21,7 @@ Feature: Test basic usage of assignment activity in app Scenario: View assign description, due date & View list of student submissions (as teacher) & View own submission or student submission # Create, edit and submit as a student - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "assignment1" in the app Then the header should be "assignment1" in the app And I should find "Test assignment description1" in the app @@ -49,9 +47,7 @@ Feature: Test basic usage of assignment activity in app And I should find "Submission test edited" in the app # View as a teacher - When I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" in the app And I press "assignment1" in the app Then the header should be "assignment1" in the app @@ -65,9 +61,7 @@ Feature: Test basic usage of assignment activity in app Scenario: Edit/Add submission (online text) & Add new attempt from previous submission & Submit for grading # Submit first attempt as a student - Given I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" in the app And I press "assignment1" in the app And I press "Add submission" in the app And I set the field "Online text submissions" to "Submission test 1st attempt" in the app @@ -76,9 +70,7 @@ Feature: Test basic usage of assignment activity in app And I press "OK" in the app # Allow more attempts as a teacher - When I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" in the app And I press "assignment1" in the app And I press "Participants" in the app And I press "Student student" near "assignment1" in the app @@ -89,9 +81,7 @@ Feature: Test basic usage of assignment activity in app And I should find "Not graded" in the app # Submit second attempt as a student - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "assignment1" in the app Then I should find "Reopened" in the app And I should find "2 out of Unlimited" in the app @@ -109,9 +99,7 @@ Feature: Test basic usage of assignment activity in app And I press "OK" in the app # View second attempt as a teacher - When I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" in the app And I press "assignment1" in the app And I press "Participants" in the app And I press "Student student" near "assignment1" in the app @@ -119,9 +107,7 @@ Feature: Test basic usage of assignment activity in app And I should find "Submission test 2nd attempt" in the app Scenario: Add submission offline (online text) & Submit for grading offline & Sync submissions - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "assignment1" in the app And I press "Add submission" in the app And I switch offline mode to "true" @@ -140,9 +126,7 @@ Feature: Test basic usage of assignment activity in app But I should not find "This Assignment has offline data to be synchronised." in the app Scenario: Edit an offline submission before synchronising it - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "assignment1" in the app And I press "Add submission" in the app And I switch offline mode to "true" diff --git a/mod/chat/tests/behat/app_basic_usage.feature b/mod/chat/tests/behat/app_basic_usage.feature index 3a09d3c86..f3727631f 100755 --- a/mod/chat/tests/behat/app_basic_usage.feature +++ b/mod/chat/tests/behat/app_basic_usage.feature @@ -21,9 +21,7 @@ Feature: Test basic usage of chat in app Scenario: Receive and send messages & See connected users, beep and talk to # Send messages as student1 - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Test chat name" in the app Then I should find "Click here to enter the chat now" in the app And I should find "View past chat sessions" in the app @@ -39,9 +37,7 @@ Feature: Test basic usage of chat in app And I should find "I am David" in the app # Read messages, view connected users, send beep and reply as student2 - When I enter the app - And I log in as "student2" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student2" 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 find "Hi!" in the app @@ -59,9 +55,7 @@ Feature: Test basic usage of chat in app Scenario: Past sessions shown # Send messages as student1 - Given I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" 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 And I set the field "New message" to "Hi!" in the app @@ -73,9 +67,7 @@ Feature: Test basic usage of chat in app Then I should find "I am David" in the app # Read messages from past sessions as student2 - When I enter the app - And I log in as "student2" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student2" in the app And I press "Test chat name" in the app And I press "View past chat sessions" in the app And I press "Show incomplete sessions" in the app diff --git a/mod/choice/tests/behat/app_basic_usage.feature b/mod/choice/tests/behat/app_basic_usage.feature index f4e85faaf..abf5a0c53 100755 --- a/mod/choice/tests/behat/app_basic_usage.feature +++ b/mod/choice/tests/behat/app_basic_usage.feature @@ -21,9 +21,7 @@ Feature: Test basic usage of choice activity in app 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Test single choice name" in the app And I select "Option 1" in the app And I select "Option 2" in the app @@ -46,9 +44,7 @@ Feature: Test basic usage of choice activity in app 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Test multi choice name" in the app And I select "Option 1" in the app And I select "Option 2" in the app @@ -76,9 +72,7 @@ Feature: Test basic usage of choice activity in app 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Test single choice name" in the app And I select "Option 1" in the app And I switch offline mode to "true" @@ -110,9 +104,7 @@ Feature: Test basic usage of choice activity in app 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Test single choice name" in the app And I select "Option 1" in the app And I switch offline mode to "true" @@ -139,9 +131,7 @@ Feature: Test basic usage of choice activity in app | 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 | | 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Display options" in the app And I press "Show download options" in the app And I press "Download" near "Test single choice name" in the app @@ -180,18 +170,14 @@ Feature: Test basic usage of choice activity in app Given the following "activities" exist: | activity | name | intro | course | idnumber | option | | choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | - And I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + And I enter the course "Course 1" as "student1" in the app And I press "Choice name" in the app And I select "Option 2" in the app And I press "Save my choice" in the app And I press "OK" in the app # Download answers as teacher - When I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" in the app And I press "Choice name" in the app Then I should find "Test choice description" in the app diff --git a/mod/comments/tests/behat/app_basic_usage.feature b/mod/comments/tests/behat/app_basic_usage.feature index 9064d47ab..c398038d4 100755 --- a/mod/comments/tests/behat/app_basic_usage.feature +++ b/mod/comments/tests/behat/app_basic_usage.feature @@ -26,9 +26,7 @@ Feature: Test basic usage of comments in app @app @3.8.0 Scenario: Add comments & Delete comments (database) # Create database entry and comment as a teacher - Given I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "teacher1" 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 @@ -39,9 +37,7 @@ Feature: Test basic usage of comments in app | 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" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" 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 @@ -58,9 +54,7 @@ Feature: Test basic usage of comments in app And I should see "Comments (1)" # Create and delete comments as a student - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -85,9 +79,7 @@ Feature: Test basic usage of comments in app @app @3.8.0 Scenario: Add comments offline & Delete comments offline & Sync comments (database) - Given I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "teacher1" 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 @@ -98,9 +90,7 @@ Feature: Test basic usage of comments in app | 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" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" 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 @@ -148,9 +138,7 @@ Feature: Test basic usage of comments in app @app @3.8.0 Scenario: Add comments & delete comments (glossary) # Create glossary entry and comment as a teacher - When I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" 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 @@ -167,9 +155,7 @@ Feature: Test basic usage of comments in app And I should see "Comments (1)" # Create and delete comments as a student - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -194,9 +180,7 @@ Feature: Test basic usage of comments in app @app @3.8.0 Scenario: Add comments offline & Delete comments offline & Sync comments (glossary) - When I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" 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 @@ -245,9 +229,7 @@ Feature: Test basic usage of comments in app @app @3.8.0 Scenario: Add comments & Delete comments (blogs) # Create blog as a teacher - Given I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "teacher1" 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 @@ -266,9 +248,7 @@ Feature: Test basic usage of comments in app And I close the browser tab opened by the app # Create and delete comments as a student - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "menu" in the app And I press "Site blog" in the app Then I should see "Blog test" @@ -295,9 +275,7 @@ Feature: Test basic usage of comments in app @app @3.8.0 Scenario: Add comments offline & Delete comments offline & Sync comments (blogs) # Create blog as a teacher - Given I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "teacher1" 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 @@ -316,9 +294,7 @@ Feature: Test basic usage of comments in app And I close the browser tab opened by the app # Create and delete comments as a student - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "menu" in the app And I press "Site blog" in the app Then I should see "Blog test" diff --git a/mod/course/tests/behat/app_basic_usage.feature b/mod/course/tests/behat/app_basic_usage.feature index eee70602a..a51cec01e 100755 --- a/mod/course/tests/behat/app_basic_usage.feature +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -72,9 +72,7 @@ Feature: Test basic usage of one course in app | workshop | Test workshop name | Test workshop | C1 | workshop | 0 | 3 | Scenario: View course contents - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app Then the header should be "Course 1" in the app And I should find "Choice course 1" in the app And I should find "assignment" in the app @@ -149,9 +147,7 @@ Feature: Test basic usage of one course in app Then the header should be "Test workshop name" in the app Scenario: View section contents - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app Then the header should be "Course 1" in the app And I should find "Choice course 1" in the app And I should find "assignment" in the app @@ -328,9 +324,7 @@ Feature: Test basic usage of one course in app Then the header should be "Test glossary" in the app Scenario: Navigation between sections using the bottom arrows - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app Then the header should be "Course 1" in the app And I should find "Choice course 1" in the app And I should find "assignment" in the app @@ -407,9 +401,7 @@ Feature: Test basic usage of one course in app And I should not find "Topic 2" in the app Scenario: Self enrol - Given I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "teacher1" 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 @@ -445,9 +437,7 @@ Feature: Test basic usage of one course in app And I should find "Test workshop name" in the app Scenario: Guest access - Given I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "teacher1" 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 @@ -486,9 +476,7 @@ Feature: Test basic usage of one course in app | blockname | contextlevel | reference | pagetypepattern | defaultregion | configdata | | html | Course | C1 | course-view-* | site-pre | Tzo4OiJzdGRDbGFzcyI6Mjp7czo1OiJ0aXRsZSI7czoxNToiSFRNTCB0aXRsZSB0ZXN0IjtzOjQ6InRleHQiO3M6OToiYm9keSB0ZXN0Ijt9 | | activity_modules | Course | C1 | course-view-* | site-pre | | - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app Then the header should be "Course 1" in the app And I should find "Choice course 1" in the app And I should find "assignment" in the app diff --git a/mod/course/tests/behat/app_course_completion.feature b/mod/course/tests/behat/app_course_completion.feature index 52a23b979..999b55736 100644 --- a/mod/course/tests/behat/app_course_completion.feature +++ b/mod/course/tests/behat/app_course_completion.feature @@ -20,9 +20,7 @@ Feature: Check course completion feature. | activity | name | course | idnumber | completion | completionview | | forum | First forum | C1 | forum1 | 1 | 0 | | forum | Second forum | C1 | forum2 | 1 | 0 | - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app # Set activities as completed. And I should find "0%" in the app And I press "Mark First forum as done" in the app diff --git a/mod/data/tests/behat/app_data_entries.feature b/mod/data/tests/behat/app_data_entries.feature index dd8c5621b..ca214a012 100644 --- a/mod/data/tests/behat/app_data_entries.feature +++ b/mod/data/tests/behat/app_data_entries.feature @@ -32,9 +32,7 @@ Feature: Users can manage entries in database activities And I log out Scenario: Create entry - Given I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" 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 @@ -45,17 +43,13 @@ Feature: Users can manage entries in database activities And I should see "Moodle community site" Scenario: Browse entry - Given I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student2" 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 @@ -77,17 +71,13 @@ Feature: Users can manage entries in database activities And I should see "Moodle Cloud" 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 enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student2" 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 @@ -96,9 +86,7 @@ Feature: Users can manage entries in database activities And "Delete" "link" should not exist Scenario: Delete entry (student) & Update entry (student) - Given I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" 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 @@ -144,9 +132,7 @@ Feature: Users can manage entries in database activities And I should see "No entries in database" Scenario: Delete entry (teacher) & Update entry (teacher) - Given I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" 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 @@ -156,9 +142,7 @@ Feature: Users can manage entries in database activities 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" 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" diff --git a/mod/data/tests/behat/app_data_sync.feature b/mod/data/tests/behat/app_data_sync.feature index ff9b47a4f..04cc1c2c3 100644 --- a/mod/data/tests/behat/app_data_sync.feature +++ b/mod/data/tests/behat/app_data_sync.feature @@ -33,9 +33,7 @@ Feature: Users can store entries in database activities when offline and sync wh @app_from3.7 Scenario: Create entry (offline) - Given I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" 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" @@ -55,9 +53,7 @@ Feature: Users can store entries in database activities when offline and sync wh @app_from3.7 Scenario: Update entry (offline) & Delete entry (offline) - Given I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" 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 @@ -106,9 +102,7 @@ Feature: Users can store entries in database activities when offline and sync wh @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 enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" 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 diff --git a/mod/forum/tests/behat/app_basic_usage.feature b/mod/forum/tests/behat/app_basic_usage.feature index 681e6219f..6789902d1 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -25,9 +25,7 @@ Feature: Test basic usage of forum activity in app | forum | Test forum name | Test forum | C1 | forum | 0 | 1 | 1 | Scenario: Create new discussion - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 "My happy subject" in the app @@ -39,9 +37,7 @@ Feature: Test basic usage of forum activity in app Then I should find "An awesome message" in the app Scenario: Reply a post - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -57,9 +53,7 @@ Feature: Test basic usage of forum activity in app And I should find "ReplyMessage" in the app Scenario: Star and pin discussions (student) - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 "starred subject" in the app @@ -93,9 +87,7 @@ Feature: Test basic usage of forum activity in app Then I should find "normal message" in the app Scenario: Star and pin discussions (teacher) - When I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" 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 "Auto-test star" in the app @@ -125,9 +117,7 @@ Feature: Test basic usage of forum activity in app And I should find "Auto-test pin" in the app Scenario: Edit a not sent reply offline - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 "Auto-test" in the app @@ -160,9 +150,7 @@ Feature: Test basic usage of forum activity in app And I should not find "This Discussion has offline data to be synchronised" in the app Scenario: Edit a not sent new discussion offline - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -185,9 +173,7 @@ Feature: Test basic usage of forum activity in app And I should find "Auto-test message edited" in the app Scenario: Edit a forum post (only online) - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 "Auto-test" in the app @@ -213,9 +199,7 @@ Feature: Test basic usage of forum activity in app Then I should find "There was a problem connecting to the site. Please check your connection and try again." in the app Scenario: Delete a forum post (only online) - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 "Auto-test" in the app @@ -248,9 +232,7 @@ Feature: Test basic usage of forum activity in app Then I should not find "Auto-test" in the app Scenario: Add/view ratings - Given I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + Given I enter the course "Course 1" as "student1" 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 "Auto-test" in the app @@ -262,9 +244,7 @@ Feature: Test basic usage of forum activity in app When I press "Reply" in the app And I set the field "Message" to "test2" 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" in the app And I press "Test forum name" in the app And I press "Auto-test" in the app Then I should find "Reply" in the app @@ -291,9 +271,7 @@ Feature: Test basic usage of forum activity in app And I should find "Average of ratings: 0" in the app But I should not find "Average of ratings: -" in the app - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Test forum name" in the app And I press "Auto-test" in the app Then I should find "Average of ratings: 1" in the app @@ -301,9 +279,7 @@ Feature: Test basic usage of forum activity in app But I should not find "Average of ratings: -" in the app Scenario: Reply a post offline - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -333,9 +309,7 @@ Feature: Test basic usage of forum activity in app But I should not find "Not sent" in the app Scenario: New discussion offline & Sync Forum - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -358,9 +332,7 @@ Feature: Test basic usage of forum activity in app And I should not find "This Forum has offline data to be synchronised." in the app Scenario: New discussion offline & Auto-sync forum - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -383,9 +355,7 @@ Feature: Test basic usage of forum activity in app And I should not find "This Forum has offline data to be synchronised." in the app Scenario: Prefetch - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 1" in the app diff --git a/mod/glossary/tests/behat/app_basic_usage.feature b/mod/glossary/tests/behat/app_basic_usage.feature index fee4f409d..5fcb2e3dd 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -27,9 +27,7 @@ Feature: Test basic usage of glossary in app @app @3.8.0 Scenario: View a glossary and its terms - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -54,9 +52,7 @@ Feature: Test basic usage of glossary in app @app @3.8.0 Scenario: Change filters (include search) - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -92,9 +88,7 @@ Feature: Test basic usage of glossary in app @app @3.8.0 Scenario: Navigate to glossary terms by link (auto-linking) When the "glossary" filter is "on" - And I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + And I enter the course "Course 1" as "student1" 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 @@ -137,9 +131,7 @@ Feature: Test basic usage of glossary in app @app @3.8.0 Scenario: See comments # Create entries as a student - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -162,9 +154,7 @@ Feature: Test basic usage of glossary in app Then I should see "Comments (0)" # Write comments as a teacher - When I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" in the app And I press "Test glossary" in the app And I press "mountain" in the app Then I should see "Comments (0)" @@ -184,9 +174,7 @@ Feature: Test basic usage of glossary in app And I should see "teacher second comment" # View comments as a student - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Test glossary" in the app And I press "mountain" in the app Then I should see "Comments (2)" @@ -197,9 +185,7 @@ Feature: Test basic usage of glossary in app @app @3.8.0 Scenario: Prefetch - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -238,9 +224,7 @@ Feature: Test basic usage of glossary in app @app @3.8.0 Scenario: Sync - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -280,9 +264,7 @@ Feature: Test basic usage of glossary in app @app @3.8.0 Scenario: Add/view ratings # Create entries as a student - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -302,9 +284,7 @@ Feature: Test basic usage of glossary in app And I should see "potato" # Rate entries as teacher1 - When I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" 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: -" @@ -314,9 +294,7 @@ Feature: Test basic usage of glossary in app Then I should see "Average of ratings: 1" # Rate entries as teacher2 - When I enter the app - And I log in as "teacher2" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher2" 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" @@ -335,9 +313,7 @@ Feature: Test basic usage of glossary in app Then I should see "Average of ratings: 0.5" # View ratings as a student - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index dad30af63..3d2fe7489 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -289,9 +289,7 @@ Feature: Test basic usage of messages in app And I should find "Student1 student1" in the app Scenario: User blocking feature - When I enter the app - And I log in as "student2" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student2" in the app And I press "Participants" in the app And I press "Student1 student1" in the app And I press "Message" in the app @@ -300,17 +298,13 @@ Feature: Test basic usage of messages in app And I press "Block user" near "Are you sure you want to block Student1 student1?" in the app Then I should find "You have blocked this user" in the app - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 find "You are unable to message this user" in the app - When I enter the app - And I log in as "student2" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student2" in the app And I press "Participants" in the app And I press "Student1 student1" in the app And I press "Message" in the app @@ -322,9 +316,7 @@ Feature: Test basic usage of messages in app And I press "Unblock user" near "Are you sure you want to unblock Student1 student1?" in the app Then I should not find "You have blocked this user" in the app - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -334,9 +326,7 @@ Feature: Test basic usage of messages in app But I should not find "You are unable to message this user" in the app Scenario: Mute Unmute conversations - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 diff --git a/mod/quiz/tests/behat/app_basic_usage.feature b/mod/quiz/tests/behat/app_basic_usage.feature index ead2f1454..493b7acf0 100755 --- a/mod/quiz/tests/behat/app_basic_usage.feature +++ b/mod/quiz/tests/behat/app_basic_usage.feature @@ -56,9 +56,7 @@ Feature: Attempt a quiz in app | TF9 | 7 | Scenario: View a quiz entry page (attempts, status, etc.) - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Quiz 1" in the app And I press "Attempt quiz now" in the app Then I should find "Text of the first question" in the app @@ -108,9 +106,7 @@ Feature: Attempt a quiz in app And I should find "Question 2" in the app Scenario: Attempt a quiz (all question types) - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -147,9 +143,7 @@ Feature: Attempt a quiz in app And I should find "Not yet graded" in the app Scenario: Submit a quiz & Review a quiz attempt - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -160,9 +154,7 @@ Feature: Attempt a quiz in app And I press "OK" in the app Then I should find "Review of attempt 1" in the app - When I enter the app - And I log in as "teacher1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "teacher1" 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 diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature index 4a0004b43..d9744cd6f 100755 --- a/mod/survey/tests/behat/app_basic_usage.feature +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -22,9 +22,7 @@ Feature: Test basic usage of survey activity in app @app @3.8.0 Scenario: Answer a survey & View results (ATTLS) - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -79,9 +77,7 @@ Feature: Test basic usage of survey activity in app 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Test survey critical incidents" in the app And I set the field with xpath "//textarea[@aria-label='At what moment in class were you most engaged as a learner?']" to "1st answer" And I set the field with xpath "//textarea[@aria-label='At what moment in class were you most distanced as a learner?']" to "2nd answer" @@ -107,9 +103,7 @@ Feature: Test basic usage of survey activity in app 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -176,9 +170,7 @@ Feature: Test basic usage of survey activity in app 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -245,9 +237,7 @@ Feature: Test basic usage of survey activity in app 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -362,9 +352,7 @@ Feature: Test basic usage of survey activity in app 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 @@ -385,9 +373,7 @@ Feature: Test basic usage of survey activity in app 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 enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" 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 diff --git a/tests/behat/navigation_activities.feature b/tests/behat/navigation_activities.feature index a11144da3..1c93c11be 100644 --- a/tests/behat/navigation_activities.feature +++ b/tests/behat/navigation_activities.feature @@ -18,9 +18,7 @@ Feature: It navigates properly within activities. And I replace the arguments in "page" "content" Scenario: Navigates using deep links - When I enter the app - And I log in as "student" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student" in the app And I press "Page" in the app And I press "Go to label" in the app Then I should find "Label description" in the app diff --git a/tests/behat/navigation_externallinks.feature b/tests/behat/navigation_externallinks.feature index 1be8c2d91..febd346b5 100644 --- a/tests/behat/navigation_externallinks.feature +++ b/tests/behat/navigation_externallinks.feature @@ -19,9 +19,7 @@ Feature: It opens external links properly. | Test forum | student1 | Forum topic | See moodle.org | Scenario: Click an external link - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Test forum" in the app And I press "Forum topic" in the app And I press "moodle.org" in the app diff --git a/tests/behat/navigation_gestures.feature b/tests/behat/navigation_gestures.feature index 8e83275fe..67deefcb3 100644 --- a/tests/behat/navigation_gestures.feature +++ b/tests/behat/navigation_gestures.feature @@ -21,9 +21,7 @@ Feature: It navigates using gestures. | student3 | C1 | student | Scenario: Swipe between participants - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Participants" in the app And I press "Student First" in the app And I swipe to the left in the app @@ -42,9 +40,7 @@ Feature: It navigates using gestures. Then I should find "Student First" in the app Scenario: Swipe between filtered participants - When I enter the app - And I log in as "student1" - And I enter the course "Course 1" in the app + When I enter the course "Course 1" as "student1" in the app And I press "Participants" in the app And I press "Search" in the app And I set the field "Search" to "student" in the app