From fd07b4169609173808250c0c50bc43263776dd9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 29 Nov 2021 10:37:04 +0100 Subject: [PATCH] MOBILE-3806 courses: Use My courses tab to access courses --- .../tests/behat/app_basic_usage.feature | 16 +++++----- mod/chat/tests/behat/app_basic_usage.feature | 8 ++--- .../tests/behat/app_basic_usage.feature | 14 ++++----- .../tests/behat/app_basic_usage.feature | 24 +++++++-------- .../tests/behat/app_basic_usage.feature | 14 ++++----- .../tests/behat/app_course_completion.feature | 2 +- .../tests/behat/app_basic_usage.feature | 8 ++--- mod/data/tests/behat/app_data_entries.feature | 16 +++++----- mod/data/tests/behat/app_data_sync.feature | 6 ++-- mod/forum/tests/behat/app_basic_usage.feature | 30 +++++++++---------- .../tests/behat/app_basic_usage.feature | 26 ++++++++-------- .../tests/behat/app_basic_usage.feature | 10 +++---- mod/quiz/tests/behat/app_basic_usage.feature | 8 ++--- .../tests/behat/app_quiz_navigation.feature | 2 +- .../tests/behat/app_basic_usage.feature | 14 ++++----- tests/behat/behat_app.php | 28 +++++++++++++++++ tests/behat/navigation_activities.feature | 2 +- tests/behat/navigation_externallinks.feature | 2 +- tests/behat/navigation_gestures.feature | 4 +-- 19 files changed, 131 insertions(+), 103 deletions(-) diff --git a/mod/assignment/tests/behat/app_basic_usage.feature b/mod/assignment/tests/behat/app_basic_usage.feature index 722ef7cec..1c4fd025d 100755 --- a/mod/assignment/tests/behat/app_basic_usage.feature +++ b/mod/assignment/tests/behat/app_basic_usage.feature @@ -23,7 +23,7 @@ Feature: Test basic usage of assignment activity in app # Create, edit and submit as a student When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -51,7 +51,7 @@ Feature: Test basic usage of assignment activity in app # View as a teacher When I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" in the app And I press "assignment1" in the app Then the header should be "assignment1" in the app @@ -67,7 +67,7 @@ Feature: Test basic usage of assignment activity in app # Submit first attempt as a student Given I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -78,7 +78,7 @@ Feature: Test basic usage of assignment activity in app # Allow more attempts as a teacher When I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -91,7 +91,7 @@ Feature: Test basic usage of assignment activity in app # Submit second attempt as a student When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -111,7 +111,7 @@ Feature: Test basic usage of assignment activity in app # View second attempt as a teacher When I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -121,7 +121,7 @@ Feature: Test basic usage of assignment activity in 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 press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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" @@ -142,7 +142,7 @@ Feature: Test basic usage of assignment activity in app Scenario: Edit an offline submission before synchronising it When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 4a26a9949..3a09d3c86 100755 --- a/mod/chat/tests/behat/app_basic_usage.feature +++ b/mod/chat/tests/behat/app_basic_usage.feature @@ -23,7 +23,7 @@ Feature: Test basic usage of chat in app # Send messages as student1 When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -41,7 +41,7 @@ Feature: Test basic usage of chat in 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 press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -61,7 +61,7 @@ Feature: Test basic usage of chat in app # Send messages as student1 Given I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -75,7 +75,7 @@ Feature: Test basic usage of chat in app # Read messages from past sessions as student2 When I enter the app And I log in as "student2" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 98819e5d2..00622c74d 100755 --- a/mod/choice/tests/behat/app_basic_usage.feature +++ b/mod/choice/tests/behat/app_basic_usage.feature @@ -23,7 +23,7 @@ Feature: Test basic usage of choice activity in app | 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 enter the course "Course 1" 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 @@ -48,7 +48,7 @@ Feature: Test basic usage of choice activity in app | 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 enter the course "Course 1" 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 @@ -78,7 +78,7 @@ Feature: Test basic usage of choice activity in app | 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 enter the course "Course 1" 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" @@ -112,7 +112,7 @@ Feature: Test basic usage of choice activity in app | 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 enter the course "Course 1" 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" @@ -141,7 +141,7 @@ Feature: Test basic usage of choice activity in app | 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 enter the course "Course 1" 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 @@ -182,7 +182,7 @@ Feature: Test basic usage of choice activity in app | 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 press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -191,7 +191,7 @@ Feature: Test basic usage of choice activity in app # Download answers as teacher When I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 b8036aa17..9064d47ab 100755 --- a/mod/comments/tests/behat/app_basic_usage.feature +++ b/mod/comments/tests/behat/app_basic_usage.feature @@ -28,7 +28,7 @@ Feature: Test basic usage of comments in app # Create database entry and comment as a teacher Given I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -41,7 +41,7 @@ Feature: Test basic usage of comments in app And I close the browser tab opened by 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 enter the course "Course 1" 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 @@ -60,7 +60,7 @@ Feature: Test basic usage of comments in app # Create and delete comments as a student When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -87,7 +87,7 @@ Feature: Test basic usage of comments in app Scenario: Add comments offline & Delete comments offline & Sync comments (database) Given I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -100,7 +100,7 @@ Feature: Test basic usage of comments in app And I close the browser tab opened by 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 enter the course "Course 1" 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 @@ -150,7 +150,7 @@ Feature: Test basic usage of comments in app # Create glossary entry and comment as a teacher When I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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 @@ -169,7 +169,7 @@ Feature: Test basic usage of comments in app # Create and delete comments as a student When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -196,7 +196,7 @@ Feature: Test basic usage of comments in app Scenario: Add comments offline & Delete comments offline & Sync comments (glossary) When I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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 @@ -247,7 +247,7 @@ Feature: Test basic usage of comments in app # Create blog as a teacher Given I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -268,7 +268,7 @@ Feature: Test basic usage of comments in app # Create and delete comments as a student When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" in the app And I press "menu" in the app And I press "Site blog" in the app Then I should see "Blog test" @@ -297,7 +297,7 @@ Feature: Test basic usage of comments in app # Create blog as a teacher Given I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -318,7 +318,7 @@ Feature: Test basic usage of comments in app # Create and delete comments as a student When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 7fe904f2c..f752dd799 100755 --- a/mod/course/tests/behat/app_basic_usage.feature +++ b/mod/course/tests/behat/app_basic_usage.feature @@ -74,7 +74,7 @@ Feature: Test basic usage of one course in app Scenario: View course contents When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -151,7 +151,7 @@ Feature: Test basic usage of one course in app Scenario: View section contents When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -330,7 +330,7 @@ Feature: Test basic usage of one course in app Scenario: Navigation between sections using the bottom arrows When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -409,7 +409,7 @@ Feature: Test basic usage of one course in app Scenario: Self enrol Given I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -449,7 +449,7 @@ Feature: Test basic usage of one course in app Scenario: Guest access Given I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -489,7 +489,7 @@ Feature: Test basic usage of one course in app Scenario: View blocks on drawer Given I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -511,7 +511,7 @@ Feature: Test basic usage of one course in app And I close the browser tab opened by the 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 enter the course "Course 1" 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 129f56c79..52a23b979 100644 --- a/mod/course/tests/behat/app_course_completion.feature +++ b/mod/course/tests/behat/app_course_completion.feature @@ -22,7 +22,7 @@ Feature: Check course completion feature. | forum | Second forum | C1 | forum2 | 1 | 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 enter the course "Course 1" 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/courses/tests/behat/app_basic_usage.feature b/mod/courses/tests/behat/app_basic_usage.feature index 5f3ead46c..bed2e812a 100755 --- a/mod/courses/tests/behat/app_basic_usage.feature +++ b/mod/courses/tests/behat/app_basic_usage.feature @@ -60,7 +60,7 @@ Feature: Test basic usage of courses in app And I should find "Course 2" in the app And I should find "Course 3" in the app - When I press "Course 1" near "Course overview" in the app + When I press "Course 1" in the app Then I should find "Choice course 1" in the app And the header should be "Course 1" in the app @@ -70,12 +70,12 @@ Feature: Test basic usage of courses in app When I press the back button in the app And I press the back button in the app - And I press "Course 2" near "Course overview" in the app + And I press "Course 2" in the app Then I should find "Choice course 2" in the app And the header should be "Course 2" in the app When I press the back button in the app - And I press "Course 3" near "Course overview" in the app + And I press "Course 3" in the app Then I should find "Choice course 3" in the app And the header should be "Course 3" in the app @@ -108,7 +108,7 @@ Feature: Test basic usage of courses in app Then I press "Open block drawer" in the app Then I should find "Timeline" in the app - Given I press "Course 1" near "Course overview" in the app + Given I press "Course 1" in the app And I press "assignment" in the app And I press "Display options" in the app And I press "Open in browser" in the app diff --git a/mod/data/tests/behat/app_data_entries.feature b/mod/data/tests/behat/app_data_entries.feature index 5fb346918..dd8c5621b 100644 --- a/mod/data/tests/behat/app_data_entries.feature +++ b/mod/data/tests/behat/app_data_entries.feature @@ -34,7 +34,7 @@ Feature: Users can manage entries in database activities Scenario: Create entry Given I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -47,7 +47,7 @@ Feature: Users can manage entries in database activities Scenario: Browse entry Given I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -55,7 +55,7 @@ Feature: Users can manage entries in database activities 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 enter the course "Course 1" 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 @@ -79,7 +79,7 @@ Feature: Users can manage entries in database activities 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 enter the course "Course 1" 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 @@ -87,7 +87,7 @@ Feature: Users can manage entries in database activities 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 enter the course "Course 1" 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 @@ -98,7 +98,7 @@ Feature: Users can manage entries in database activities Scenario: Delete entry (student) & Update entry (student) Given I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -146,7 +146,7 @@ Feature: Users can manage entries in database activities Scenario: Delete entry (teacher) & Update entry (teacher) Given I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -158,7 +158,7 @@ Feature: Users can manage entries in database activities 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 enter the course "Course 1" 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 065ffe35f..ff9b47a4f 100644 --- a/mod/data/tests/behat/app_data_sync.feature +++ b/mod/data/tests/behat/app_data_sync.feature @@ -35,7 +35,7 @@ Feature: Users can store entries in database activities when offline and sync wh Scenario: Create entry (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 enter the course "Course 1" 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" @@ -57,7 +57,7 @@ Feature: Users can store entries in database activities when offline and sync wh Scenario: Update entry (offline) & Delete entry (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 enter the course "Course 1" 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 @@ -108,7 +108,7 @@ Feature: Users can store entries in database activities when offline and sync wh 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 enter the course "Course 1" 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 b2cb3d8ac..c9c5ad14e 100755 --- a/mod/forum/tests/behat/app_basic_usage.feature +++ b/mod/forum/tests/behat/app_basic_usage.feature @@ -27,7 +27,7 @@ Feature: Test basic usage of forum activity in app Scenario: Create new 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 enter the course "Course 1" 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 @@ -41,7 +41,7 @@ Feature: Test basic usage of forum activity in app Scenario: Reply a post When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -59,7 +59,7 @@ Feature: Test basic usage of forum activity in app Scenario: Star and pin discussions (student) When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -95,7 +95,7 @@ Feature: Test basic usage of forum activity in app Scenario: Star and pin discussions (teacher) When I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -127,7 +127,7 @@ Feature: Test basic usage of forum activity in app Scenario: Edit a not sent reply 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 enter the course "Course 1" 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 @@ -162,7 +162,7 @@ Feature: Test basic usage of forum activity in app 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 enter the course "Course 1" 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 @@ -187,7 +187,7 @@ Feature: Test basic usage of forum activity in app Scenario: Edit 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 enter the course "Course 1" 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 @@ -215,7 +215,7 @@ Feature: Test basic usage of forum activity in app 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 enter the course "Course 1" 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 @@ -249,7 +249,7 @@ Feature: Test basic usage of forum activity in app Scenario: Add/view ratings Given I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -263,7 +263,7 @@ Feature: Test basic usage of forum activity in 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 enter the course "Course 1" 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 @@ -292,7 +292,7 @@ Feature: Test basic usage of forum 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 enter the course "Course 1" 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 @@ -302,7 +302,7 @@ Feature: Test basic usage of forum activity in app Scenario: Reply a post 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 enter the course "Course 1" 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 @@ -334,7 +334,7 @@ Feature: Test basic usage of forum activity in app Scenario: New discussion offline & 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 enter the course "Course 1" 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 @@ -359,7 +359,7 @@ Feature: Test basic usage of forum activity in app Scenario: New discussion offline & 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 enter the course "Course 1" 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 @@ -384,7 +384,7 @@ Feature: Test basic usage of forum activity in app Scenario: Prefetch When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 169345a26..fee4f409d 100755 --- a/mod/glossary/tests/behat/app_basic_usage.feature +++ b/mod/glossary/tests/behat/app_basic_usage.feature @@ -29,7 +29,7 @@ Feature: Test basic usage of glossary in app Scenario: View a glossary and its terms When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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 @@ -56,7 +56,7 @@ Feature: Test basic usage of glossary in app Scenario: Change filters (include search) When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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 @@ -94,7 +94,7 @@ Feature: Test basic usage of glossary in app When the "glossary" filter is "on" And I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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 @@ -139,7 +139,7 @@ Feature: Test basic usage of glossary in app # Create entries as a student When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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 @@ -164,7 +164,7 @@ Feature: Test basic usage of glossary in app # Write comments as a teacher When I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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)" @@ -186,7 +186,7 @@ Feature: Test basic usage of glossary in app # View comments as a student When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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)" @@ -199,7 +199,7 @@ Feature: Test basic usage of glossary in app Scenario: Prefetch When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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 @@ -222,7 +222,7 @@ Feature: Test basic usage of glossary in 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 "Course overview" in the app + And I enter the course "Course 1" 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 @@ -240,7 +240,7 @@ Feature: Test basic usage of glossary in app Scenario: Sync When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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 @@ -282,7 +282,7 @@ Feature: Test basic usage of glossary in app # Create entries as a student When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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 @@ -304,7 +304,7 @@ Feature: Test basic usage of glossary in app # Rate entries as teacher1 When I enter the app And I log in as "teacher1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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: -" @@ -316,7 +316,7 @@ Feature: Test basic usage of glossary in app # Rate entries as teacher2 When I enter the app And I log in as "teacher2" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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" @@ -337,7 +337,7 @@ Feature: Test basic usage of glossary in app # View ratings as a student When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "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 diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index a03944489..7af987d3f 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -292,7 +292,7 @@ Feature: Test basic usage of messages in app Scenario: User blocking feature When I enter the app And I log in as "student2" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -303,7 +303,7 @@ Feature: Test basic usage of messages 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 enter the course "Course 1" 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 @@ -311,7 +311,7 @@ Feature: Test basic usage of messages in 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 enter the course "Course 1" 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 @@ -325,7 +325,7 @@ Feature: Test basic usage of messages 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 enter the course "Course 1" 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 @@ -337,7 +337,7 @@ Feature: Test basic usage of messages in app Scenario: Mute Unmute conversations When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 d03e3c9db..ead2f1454 100755 --- a/mod/quiz/tests/behat/app_basic_usage.feature +++ b/mod/quiz/tests/behat/app_basic_usage.feature @@ -58,7 +58,7 @@ Feature: Attempt a quiz in app 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 enter the course "Course 1" 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 @@ -110,7 +110,7 @@ Feature: Attempt a quiz in app 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 enter the course "Course 1" 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 @@ -149,7 +149,7 @@ Feature: Attempt a quiz in app Scenario: Submit a quiz & 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 enter the course "Course 1" 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 @@ -162,7 +162,7 @@ Feature: Attempt a quiz in 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 enter the course "Course 1" 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/quiz/tests/behat/app_quiz_navigation.feature b/mod/quiz/tests/behat/app_quiz_navigation.feature index acf59c360..6cd114a3b 100644 --- a/mod/quiz/tests/behat/app_quiz_navigation.feature +++ b/mod/quiz/tests/behat/app_quiz_navigation.feature @@ -32,7 +32,7 @@ Feature: Attempt a quiz in app Scenario: Next and previous navigation Given I enter the app And I log in as "student1" - When I press "Course 1" near "Course overview" in the app + When I enter the course "Course 1" 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 diff --git a/mod/survey/tests/behat/app_basic_usage.feature b/mod/survey/tests/behat/app_basic_usage.feature index fcba1840e..4a0004b43 100755 --- a/mod/survey/tests/behat/app_basic_usage.feature +++ b/mod/survey/tests/behat/app_basic_usage.feature @@ -24,7 +24,7 @@ Feature: Test basic usage of survey activity in app Scenario: Answer a survey & View results (ATTLS) When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -81,7 +81,7 @@ Feature: Test basic usage of survey activity in app | 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 enter the course "Course 1" 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" @@ -109,7 +109,7 @@ Feature: Test basic usage of survey activity in app | 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 enter the course "Course 1" 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 @@ -178,7 +178,7 @@ Feature: Test basic usage of survey activity in app | 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 enter the course "Course 1" 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 @@ -247,7 +247,7 @@ Feature: Test basic usage of survey activity in app | 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 enter the course "Course 1" 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 @@ -364,7 +364,7 @@ Feature: Test basic usage of survey activity in app | 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 enter the course "Course 1" 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 @@ -387,7 +387,7 @@ Feature: Test basic usage of survey activity in app | 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 enter the course "Course 1" 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/behat_app.php b/tests/behat/behat_app.php index 87c23602c..fb7fd3937 100644 --- a/tests/behat/behat_app.php +++ b/tests/behat/behat_app.php @@ -533,6 +533,34 @@ class behat_app extends behat_base { $this->wait_for_pending_js(); } + /** + * User enters a course in the app. + * + * @Given /^I enter the course "(.+)" in the app$/ + * @param string $coursename Course name + * @throws DriverException If the button push doesn't work + */ + public function i_enter_the_course_in_the_app(string $coursename) { + try { + $this->i_press_in_the_app('"My courses" near "Messages"'); + } catch (DriverException $e) { + // My courses not present enter from Dashboard. + $this->i_press_in_the_app('"Home" near "Messages"'); + $this->i_press_in_the_app('"Dashboard"'); + $this->i_press_in_the_app('"'.$coursename.'" near "Course overview"'); + + $this->wait_for_pending_js(); + + return true; + } + + $this->i_press_in_the_app('"'.$coursename.'"'); + + $this->wait_for_pending_js(); + + return true; + } + /** * Presses standard buttons in the app. * diff --git a/tests/behat/navigation_activities.feature b/tests/behat/navigation_activities.feature index 210b8293e..a11144da3 100644 --- a/tests/behat/navigation_activities.feature +++ b/tests/behat/navigation_activities.feature @@ -20,7 +20,7 @@ Feature: It navigates properly within activities. Scenario: Navigates using deep links When I enter the app And I log in as "student" - And I press "Course 1" in the app + And I enter the course "Course 1" 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 b3da3c3be..1be8c2d91 100644 --- a/tests/behat/navigation_externallinks.feature +++ b/tests/behat/navigation_externallinks.feature @@ -21,7 +21,7 @@ Feature: It opens external links properly. Scenario: Click an external link When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 e51465d27..8e83275fe 100644 --- a/tests/behat/navigation_gestures.feature +++ b/tests/behat/navigation_gestures.feature @@ -23,7 +23,7 @@ Feature: It navigates using gestures. Scenario: Swipe between participants When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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 @@ -44,7 +44,7 @@ Feature: It navigates using gestures. Scenario: Swipe between filtered participants When I enter the app And I log in as "student1" - And I press "Course 1" near "Course overview" in the app + And I enter the course "Course 1" 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