From e2e179273956da95d37e66f03eec00bfb679ede7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 4 Sep 2024 17:10:01 +0200 Subject: [PATCH] MOBILE-4616 behat: Add an step to go back to root and go back many times --- .../tests/behat/behat_app.php | 47 ++++++++++- .../tests/behat/create_events.feature | 2 +- .../competency/tests/behat/navigation.feature | 10 +-- .../messages/tests/behat/basic_usage.feature | 21 +++-- .../messages/tests/behat/navigation.feature | 3 +- .../assign/tests/behat/basic_usage.feature | 4 +- .../tests/behat/marking_workflow-404.feature | 4 +- .../tests/behat/marking_workflow.feature | 4 +- .../mod/assign/tests/behat/navigation.feature | 12 ++- .../tests/behat/basic_usage.feature | 8 +- .../mod/book/tests/behat/basic_usage.feature | 11 +-- .../mod/chat/tests/behat/basic_usage.feature | 4 +- .../mod/chat/tests/behat/navigation.feature | 2 +- .../choice/tests/behat/basic_usage.feature | 14 ++-- .../mod/data/tests/behat/entries.feature | 2 +- src/addons/mod/data/tests/behat/sync.feature | 8 +- .../feedback/tests/behat/navigation.feature | 13 ++- .../mod/forum/tests/behat/basic_usage.feature | 18 ++--- .../mod/forum/tests/behat/groups.feature | 15 ++-- .../mod/forum/tests/behat/navigation.feature | 4 +- .../glossary/tests/behat/basic_usage.feature | 12 +-- .../glossary/tests/behat/navigation.feature | 8 +- .../behat/numerical_decimal_separator.feature | 10 +-- .../mod/quiz/tests/behat/basic_usage.feature | 2 +- .../mod/quiz/tests/behat/can_review.feature | 12 ++- .../tests/behat/appearance_options.feature | 35 ++++---- .../tests/behat/attempts_and_grading.feature | 78 +++++++++--------- .../scorm/tests/behat/availability.feature | 4 +- .../mod/scorm/tests/behat/basic_usage.feature | 8 +- .../survey/tests/behat/basic_usage.feature | 6 +- .../workshop/tests/behat/basic_usage.feature | 2 +- .../tests/behat/notifications.feature | 4 +- .../comments/tests/behat/basic_usage.feature | 40 +++++----- .../tests/behat/basic_usage-403.feature | 26 +++--- .../course/tests/behat/basic_usage.feature | 52 ++++++------ .../tests/behat/basic-usage-402.feature | 5 +- .../courses/tests/behat/basic_usage.feature | 10 +-- .../grades/tests/behat/navigation.feature | 9 +-- .../features/grades/tests/behat/view.feature | 4 +- .../tests/behat/showloginform_setting.feature | 10 +-- .../policy/tests/behat/consent.feature | 2 +- .../search/tests/behat/global-search.feature | 4 +- .../tests/behat/settings_navigation.feature | 11 ++- .../settings/tests/behat/sync.feature | 19 ++--- .../user/tests/behat/basic_usage.feature | 3 +- .../usertours/tests/behat/usertours.feature | 2 +- .../tests/behat/navigation_activities.feature | 4 +- .../tests/behat/navigation_deeplinks.feature | 6 +- .../behat/navigation_externallinks.feature | 2 +- .../tests/behat/navigation_splitview.feature | 8 +- src/core/tests/behat/open_files.feature | 13 ++- src/testing/services/behat-runtime.ts | 80 ++++++++++++++++++- 52 files changed, 388 insertions(+), 309 deletions(-) diff --git a/local_moodleappbehat/tests/behat/behat_app.php b/local_moodleappbehat/tests/behat/behat_app.php index ca9a1557b..012aff300 100644 --- a/local_moodleappbehat/tests/behat/behat_app.php +++ b/local_moodleappbehat/tests/behat/behat_app.php @@ -467,7 +467,7 @@ class behat_app extends behat_app_helper { /** * Presses standard buttons in the app. * - * @When /^I press the (back|more menu|page menu|user menu|main menu) button in the app$/ + * @When /^I press the (back|more menu|page menu|user menu) button in the app$/ * @param string $button Button type * @throws DriverException If the button push doesn't work */ @@ -485,6 +485,51 @@ class behat_app extends behat_app_helper { $this->wait_for_pending_js(); } + /** + * Presses go back repeatedly in the app. + * + * @When /^I go back( (\d+) times)? in the app$/ + * @param int $times + * @throws DriverException If the navigation doesn't work + */ + public function i_go_back_x_times_in_the_app(?string $unused = null, ?int $times = 1) { + if ($times < 1) { + return; + } + + $this->spin(function() use ($times) { + $result = $this->runtime_js("goBackTimes($times)"); + + if ($result !== 'OK') { + throw new DriverException('Error navigating back - ' . $result); + } + + return true; + }); + + $this->wait_for_pending_js(); + } + + /** + * Presses go back repeatedly until the app is in the main menu. + * + * @When /^I go back to the root page in the app$/ + * @throws DriverException If the navigation doesn't work + */ + public function i_go_back_to_root_in_the_app() { + $this->spin(function() { + $result = $this->runtime_js("goBackToRoot()"); + + if ($result !== 'OK') { + throw new DriverException('Error navigating to root - ' . $result); + } + + return true; + }); + + $this->wait_for_pending_js(); + } + /** * Receives push notifications. * diff --git a/src/addons/calendar/tests/behat/create_events.feature b/src/addons/calendar/tests/behat/create_events.feature index e182ba6c0..6bdd36283 100755 --- a/src/addons/calendar/tests/behat/create_events.feature +++ b/src/addons/calendar/tests/behat/create_events.feature @@ -23,7 +23,7 @@ Feature: Test creation of calendar events in app # This test is flaky due to timestamp. Scenario: Create user event as student from monthly view Given I entered the app as "student1" - When I press "More" in the app + When I press the more menu button in the app And I press "Calendar" in the app And I press "New event" in the app # Flaky step, sometimes it fails due to minute change when checking. diff --git a/src/addons/competency/tests/behat/navigation.feature b/src/addons/competency/tests/behat/navigation.feature index 17d5c1d84..416b25784 100644 --- a/src/addons/competency/tests/behat/navigation.feature +++ b/src/addons/competency/tests/behat/navigation.feature @@ -115,9 +115,7 @@ Feature: Test competency navigation But I should not find "Cakes" in the app # Learning plans - When I press the back button in the app - And I press the back button in the app - And I press the back button in the app + When I go back to the root page in the app And I press the user menu button in the app And I press "Learning plans" in the app Then I should find "Cookery" in the app @@ -236,9 +234,7 @@ Feature: Test competency navigation But I should not find "Cakes" in the app # User learning plans - When I press the back button in the app - And I press the back button in the app - And I press the back button in the app + When I go back to the root page in the app And I press "Messages" in the app And I press "Search people and messages" in the app And I set the field "Search" to "student" in the app @@ -482,7 +478,7 @@ Feature: Test competency navigation When I entered the course "Course 1" as "student1" in the app Then I should not find "Competencies" in the app - When I press the back button in the app + When I go back to the root page in the app And I press the user menu button in the app Then I should not find "Learning plans" in the app diff --git a/src/addons/messages/tests/behat/basic_usage.feature b/src/addons/messages/tests/behat/basic_usage.feature index c1fabfc4e..a143eb294 100755 --- a/src/addons/messages/tests/behat/basic_usage.feature +++ b/src/addons/messages/tests/behat/basic_usage.feature @@ -52,12 +52,12 @@ Feature: Test basic usage of messages in app And I replace "/.*/" within ".message-time" with "[Date]" Then the UI should match the snapshot - When I press the back button in the app + When I go back in the app And I press "Contacts" near "No contact requests" in the app Then the header should be "Contacts" in the app And I should find "Teacher teacher" in the app - When I press the back button in the app + When I go back in the app And I press "Teacher teacher" in the app Then the header should be "Teacher teacher" in the app And I should find "heeey student" in the app @@ -160,8 +160,7 @@ Feature: Test basic usage of messages in app And I press "Remove from contacts" in the app And I press "Remove" in the app And I wait loading to finish in the app - And I press the back button in the app - And I press the back button in the app + And I go back 2 times in the app And I press "Display options" in the app Then I should find "Add to contacts" in the app @@ -188,7 +187,7 @@ Feature: Test basic usage of messages in app Then I should find "byee" in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app And I press "Student1 student1" in the app Then I should find "heeey student" in the app And I should find "byee" in the app @@ -279,7 +278,7 @@ Feature: Test basic usage of messages in app When I press "star message" in the app And I press "Display options" in the app And I press "Star conversation" in the app - And I press the back button in the app + And I go back in the app Then I should find "Private (1)" in the app And I should find "Starred (2)" in the app @@ -345,7 +344,8 @@ Feature: Test basic usage of messages in app When I press "Mute" in the app Then I should find "Muted conversation" in the app - When I press "Messages" in the app + When I go back to the root page in the app + And I press "Messages" in the app And I press "Private (1)" in the app And I press "Student2 student2" in the app Then I should find "test message" in the app @@ -367,7 +367,7 @@ Feature: Test basic usage of messages in app Then I should find "self conversation offline" in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app And I press "Student1 student1" in the app And I press "Display options" in the app Then I should find "Show delete messages" in the app @@ -394,7 +394,7 @@ Feature: Test basic usage of messages in app Then I should not find "self conversation online" in the app And I should not find "self conversation offline" in the app - When I press the back button in the app + When I go back in the app And I press "Search people and messages" in the app And I set the field "Search" to "Student1 student1" in the app And I press "Search" "button" in the app @@ -403,8 +403,7 @@ Feature: Test basic usage of messages in app And I press "Send" in the app Then I should find "auto search test" in the app - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "Private" in the app And I press "Student1 student1" in the app Then I should find "auto search test" in the app diff --git a/src/addons/messages/tests/behat/navigation.feature b/src/addons/messages/tests/behat/navigation.feature index 5011c529c..4ada3e7df 100644 --- a/src/addons/messages/tests/behat/navigation.feature +++ b/src/addons/messages/tests/behat/navigation.feature @@ -37,6 +37,5 @@ Feature: Test messages navigation in the app Then I should not find "User info" in the app When I close the popup in the app - And I press the back button in the app - And I press the back button in the app + And I go back 2 times in the app Then I should find "Hi there" in the app diff --git a/src/addons/mod/assign/tests/behat/basic_usage.feature b/src/addons/mod/assign/tests/behat/basic_usage.feature index 51f9cd6e9..86cccde78 100755 --- a/src/addons/mod/assign/tests/behat/basic_usage.feature +++ b/src/addons/mod/assign/tests/behat/basic_usage.feature @@ -131,7 +131,7 @@ Feature: Test basic usage of assignment activity in app Then I should find "This Assignment has offline data to be synchronised." in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app And I press "assignment1" in the app And I press "Information" in the app And I press "Refresh" in the app @@ -159,7 +159,7 @@ Feature: Test basic usage of assignment activity in app Then I should find "This Assignment has offline data to be synchronised." in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app And I press "assignment1" in the app Then I should find "Submitted for grading" in the app And I should find "Submission test edited offline" in the app diff --git a/src/addons/mod/assign/tests/behat/marking_workflow-404.feature b/src/addons/mod/assign/tests/behat/marking_workflow-404.feature index 90209ea78..b3803b649 100755 --- a/src/addons/mod/assign/tests/behat/marking_workflow-404.feature +++ b/src/addons/mod/assign/tests/behat/marking_workflow-404.feature @@ -84,7 +84,7 @@ Feature: Test marking workflow in assignment activity in app And the field "Grade out of 100" matches value "50" in the app And I should not find "Graded by" in the app - When I press the back button in the app + When I go back in the app And I press "Student3" in the app And I press "Grade" in the app Then I should find "Submitted for grading" in the app @@ -109,7 +109,7 @@ Feature: Test marking workflow in assignment activity in app And I should find "In review" within "Marking workflow state" "ion-item" in the app And the field "Grade out of 100" matches value "60" in the app - When I press the back button in the app + When I go back in the app And I press "Student3" in the app And I press "Grade" in the app When I set the field "Grade out of 100" to "80" in the app diff --git a/src/addons/mod/assign/tests/behat/marking_workflow.feature b/src/addons/mod/assign/tests/behat/marking_workflow.feature index 0ddc4c6cf..dc9963f9d 100755 --- a/src/addons/mod/assign/tests/behat/marking_workflow.feature +++ b/src/addons/mod/assign/tests/behat/marking_workflow.feature @@ -84,7 +84,7 @@ Feature: Test marking workflow in assignment activity in app And the field "Grade out of 100" matches value "50" in the app And I should not find "Graded by" in the app - When I press the back button in the app + When I go back in the app And I press "Student3" in the app And I press "Grade" in the app Then I should find "Submitted for grading" in the app @@ -109,7 +109,7 @@ Feature: Test marking workflow in assignment activity in app And I should find "In review" within "Marking workflow state" "ion-item" in the app And the field "Grade out of 100" matches value "60" in the app - When I press the back button in the app + When I go back in the app And I press "Student3" in the app And I press "Grade" in the app When I set the field "Grade out of 100" to "80" in the app diff --git a/src/addons/mod/assign/tests/behat/navigation.feature b/src/addons/mod/assign/tests/behat/navigation.feature index c292094bc..d0ea01a4a 100644 --- a/src/addons/mod/assign/tests/behat/navigation.feature +++ b/src/addons/mod/assign/tests/behat/navigation.feature @@ -72,8 +72,7 @@ Feature: Test assignments navigation And I should not find "Second Student" in the app # Drafts - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "Drafts" in the app Then I should find "First Student" in the app And I should find "Third Student" in the app @@ -97,8 +96,7 @@ Feature: Test assignments navigation And I should not find "Second Student" in the app # Filter groups in assignment page - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "Separate groups" in the app And I press "Group 1" in the app Then I should find "2" near "Participants" in the app @@ -126,7 +124,7 @@ Feature: Test assignments navigation And I should not find "Third Student" in the app # Filter groups in submissions page - When I press the back button in the app + When I go back in the app And I press "Separate groups" in the app And I press "Group 2" in the app Then I should find "Second Student" in the app @@ -176,7 +174,7 @@ Feature: Test assignments navigation And I should not find "Third Student" inside the split-view content in the app # Drafts - When I press the back button in the app + When I go back in the app And I press "Drafts" in the app Then I should find "First Student" in the app And I should find "Third Student" in the app @@ -193,7 +191,7 @@ Feature: Test assignments navigation And I should not find "Second Student" in the app # Filter groups in assignment page - When I press the back button in the app + When I go back in the app And I press "Separate groups" in the app And I press "Group 1" in the app Then I should find "2" near "Participants" in the app diff --git a/src/addons/mod/bigbluebuttonbn/tests/behat/basic_usage.feature b/src/addons/mod/bigbluebuttonbn/tests/behat/basic_usage.feature index 9ca94cf76..739cada78 100755 --- a/src/addons/mod/bigbluebuttonbn/tests/behat/basic_usage.feature +++ b/src/addons/mod/bigbluebuttonbn/tests/behat/basic_usage.feature @@ -29,12 +29,12 @@ Feature: Test basic usage of BBB activity in app Then I should find "The session has not started yet." in the app And I should find "Saturday, 1 January 2050, 12:00 AM" within "Open" "ion-item" in the app - When I press the back button in the app + When I go back in the app And I press "BBB 2" in the app Then I should find "The session has ended." in the app And I should find "Saturday, 1 January 2000, 12:00 AM" within "Close" "ion-item" in the app - When I press the back button in the app + When I go back in the app And I press "BBB 3" in the app Then I should find "This room is ready. You can join the session now." in the app And I should find "Saturday, 1 January 2000, 12:00 AM" within "Open" "ion-item" in the app @@ -113,13 +113,13 @@ Feature: Test basic usage of BBB activity in app And I should find "Recordings" in the app And I should find "There are no recordings available." in the app - When I press the back button in the app + When I go back in the app And I press "Room only" in the app Then I should find "This room is ready. You can join the session now." in the app And I should be able to press "Join session" in the app But I should not find "Recordings" in the app - When I press the back button in the app + When I go back in the app And I press "Recordings only" in the app Then I should find "Recordings" in the app But I should not find "This room is ready. You can join the session now." in the app diff --git a/src/addons/mod/book/tests/behat/basic_usage.feature b/src/addons/mod/book/tests/behat/basic_usage.feature index 84829a7c8..6d9f5512a 100755 --- a/src/addons/mod/book/tests/behat/basic_usage.feature +++ b/src/addons/mod/book/tests/behat/basic_usage.feature @@ -86,7 +86,7 @@ Feature: Test basic usage of book activity in app And the UI should match the snapshot But I should not find "This is the second chapter" in the app - When I press the back button in the app + When I go back in the app And I press "Chapt 2" in the app Then I should find "Chapt 2" in the app And I should find "This is the second chapter" in the app @@ -265,8 +265,7 @@ Feature: Test basic usage of book activity in app And I should find "3. Chapt 3" in the app When I press "Close" in the app - And I press the back button in the app - And I press the back button in the app + And I go back 2 times in the app And I press "Bull book" in the app Then I should find "• Chapt 1" in the app But I should not find "1. Chapt 1" in the app @@ -277,8 +276,7 @@ Feature: Test basic usage of book activity in app But I should not find "1. Chapt 1" in the app When I press "Close" in the app - And I press the back button in the app - And I press the back button in the app + And I go back 2 times in the app And I press "Ind book" in the app Then I should find "Chapt 1" in the app But I should not find "• Chapt 1" in the app @@ -291,8 +289,7 @@ Feature: Test basic usage of book activity in app And I should not find "1. Chapt 1" in the app When I press "Close" in the app - And I press the back button in the app - And I press the back button in the app + And I go back 2 times in the app And I press "None book" in the app Then I should find "Chapt 1" in the app But I should not find "• Chapt 1" in the app diff --git a/src/addons/mod/chat/tests/behat/basic_usage.feature b/src/addons/mod/chat/tests/behat/basic_usage.feature index 6146a2d97..46e51a4e6 100755 --- a/src/addons/mod/chat/tests/behat/basic_usage.feature +++ b/src/addons/mod/chat/tests/behat/basic_usage.feature @@ -37,7 +37,7 @@ Feature: Test basic usage of chat in app Then I should find "Hi!" in the app And I should find "I am David" in the app # Confirm leave the page - And I press the back button in the app + And I go back in the app And I press "OK" in the app # Read messages, view connected users, send beep and reply as student2 @@ -76,7 +76,7 @@ Feature: Test basic usage of chat in app And I press "Send" in the app Then I should find "I am David" in the app # Confirm leave the page - And I press the back button in the app + And I go back in the app And I press "OK" in the app # Read messages from past sessions as student2 diff --git a/src/addons/mod/chat/tests/behat/navigation.feature b/src/addons/mod/chat/tests/behat/navigation.feature index 593f56324..91c52de88 100644 --- a/src/addons/mod/chat/tests/behat/navigation.feature +++ b/src/addons/mod/chat/tests/behat/navigation.feature @@ -26,7 +26,7 @@ Feature: Test chat navigation And I press "Send" in the app Then I should find "Test message" in the app # Confirm leave the page - And I press the back button in the app + And I go back in the app And I press "OK" in the app Scenario: Tablet navigation on chat diff --git a/src/addons/mod/choice/tests/behat/basic_usage.feature b/src/addons/mod/choice/tests/behat/basic_usage.feature index 07d187a99..5d087bfdf 100755 --- a/src/addons/mod/choice/tests/behat/basic_usage.feature +++ b/src/addons/mod/choice/tests/behat/basic_usage.feature @@ -33,7 +33,7 @@ Feature: Test basic usage of choice activity in app And I should find "Option 3: 0" in the app But I should not find "Remove my choice" in the app - When I press the back button in the app + When I go back in the app And I press "Test single choice name" in the app Then I should find "Option 1: 0" in the app And I should find "Option 2: 1" in the app @@ -82,7 +82,7 @@ Feature: Test basic usage of choice activity in app Then I should find "Are you sure" in the app When I press "OK" in the app - And I press the back button in the app + And I go back in the app And I press "Test single choice name" in the app Then I should find "This Choice has offline data to be synchronised." in the app But I should not find "Option 1: 0" in the app @@ -90,7 +90,7 @@ Feature: Test basic usage of choice activity in app And I should not find "Option 3: 0" in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app And I press "Test single choice name" in the app Then I should find "Test single choice description" in the app @@ -135,21 +135,21 @@ Feature: Test basic usage of choice activity in app When I press "Course downloads" in the app When I press "Download" within "Test single choice name" "ion-item" in the app Then I should find "Downloaded" within "Test single choice name" "ion-item" in the app - And I press the back button in the app + And I go back in the app When I switch network connection to offline And I press "Test multi choice name" in the app Then I should find "There was a problem connecting to the site. Please check your connection and try again." in the app When I press "OK" in the app - And I press the back button in the app + And I go back in the app And I press "Test single choice name" in the app And I select "Option 2" in the app And I press "Save my choice" in the app Then I should find "Are you sure" in the app When I press "OK" in the app - And I press the back button in the app + And I go back in the app And I press "Test single choice name" in the app Then I should find "This Choice has offline data to be synchronised." in the app But I should not find "Option 1: 0" in the app @@ -157,7 +157,7 @@ Feature: Test basic usage of choice activity in app And I should not find "Option 3: 0" in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app And I press "Test single choice name" in the app Then I should find "Option 1: 0" in the app And I should find "Option 2: 1" in the app diff --git a/src/addons/mod/data/tests/behat/entries.feature b/src/addons/mod/data/tests/behat/entries.feature index 503207096..d2e7a068f 100644 --- a/src/addons/mod/data/tests/behat/entries.feature +++ b/src/addons/mod/data/tests/behat/entries.feature @@ -75,7 +75,7 @@ Feature: Users can manage entries in database activities Then I should find "Moodle community site" in the app But I should not find "Moodle Cloud" in the app - When I press the back button in the app + When I go back in the app And I should find "Moodle community site" in the app And I should find "Moodle Cloud" in the app diff --git a/src/addons/mod/data/tests/behat/sync.feature b/src/addons/mod/data/tests/behat/sync.feature index 4d2b12f38..50dccc49a 100644 --- a/src/addons/mod/data/tests/behat/sync.feature +++ b/src/addons/mod/data/tests/behat/sync.feature @@ -39,7 +39,7 @@ Feature: Users can store entries in database activities when offline and sync wh Then I should find "https://moodle.org/" in the app And I should find "Moodle community site" in the app And I should find "This Database has offline data to be synchronised" in the app - And I press the back button in the app + And I go back in the app And I switch network connection to wifi And I press "Web links" near "General" in the app And I should find "https://moodle.org/" in the app @@ -72,7 +72,7 @@ Feature: Users can store entries in database activities when offline and sync wh And I should find "https://moodlecloud.com/" in the app And I should find "Moodle Cloud" in the app And I should find "This Database has offline data to be synchronised" in the app - And I press the back button in the app + And I go back in the app And I switch network connection to wifi And I press "Web links" near "General" in the app And I should not find "https://moodle.org/" in the app @@ -91,7 +91,7 @@ Feature: Users can store entries in database activities when offline and sync wh And I should find "https://moodlecloud.com/" in the app And I should find "Moodle Cloud" in the app And I should find "This Database has offline data to be synchronised" in the app - And I press the back button in the app + And I go back in the app And I switch network connection to wifi And I press "Web links" near "General" in the app And I should not find "https://moodlecloud.com/" in the app @@ -122,7 +122,7 @@ Feature: Users can store entries in database activities when offline and sync wh And I should find "This Database has offline data to be synchronised" in the app And I press "Actions menu" in the app And I press "Restore" in the app - And I press the back button in the app + And I go back in the app And I switch network connection to wifi And I press "Web links" near "General" in the app Then I should find "https://moodle.org/" in the app diff --git a/src/addons/mod/feedback/tests/behat/navigation.feature b/src/addons/mod/feedback/tests/behat/navigation.feature index 575d37597..6c73b0c66 100644 --- a/src/addons/mod/feedback/tests/behat/navigation.feature +++ b/src/addons/mod/feedback/tests/behat/navigation.feature @@ -282,7 +282,7 @@ Feature: Test feedback navigation Then I should find "Anonymous" within "Mode" "ion-item" in the app # Analysis - When I press the back button in the app + When I go back in the app And I press "Analysis" in the app Then I should find "student01 response" in the app And I should find "student75 response" in the app @@ -325,14 +325,13 @@ Feature: Test feedback navigation When I swipe to the left in the app Then I should find "student03 response" in the app - When I press the back button in the app + When I go back in the app And I press "Student 21" in the app And I swipe to the left in the app Then I should find "student22 response" in the app # By group - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "Separate groups" in the app And I press "Group 1" in the app Then I should find "22" near "Submitted answers" in the app @@ -369,7 +368,7 @@ Feature: Test feedback navigation Then I should find "student31 response" in the app # Reset group - When I press the back button in the app + When I go back in the app When I press "Group 1" in the app And I press "All participants" in the app Then I should find "Non anonymous entries (21)" in the app @@ -392,7 +391,7 @@ Feature: Test feedback navigation Then I should find "Anonymous" within "Mode" "ion-item" in the app # Analysis - When I press the back button in the app + When I go back in the app And I press "Analysis" in the app Then I should find "student01 response" in the app And I should find "student75 response" in the app @@ -434,7 +433,7 @@ Feature: Test feedback navigation And I should find "student22 response" inside the split-view content in the app # By group - When I press the back button in the app + When I go back in the app And I press "Separate groups" in the app And I press "Group 1" in the app Then I should find "22" near "Submitted answers" in the app diff --git a/src/addons/mod/forum/tests/behat/basic_usage.feature b/src/addons/mod/forum/tests/behat/basic_usage.feature index 8f9026d80..e0aebd9be 100755 --- a/src/addons/mod/forum/tests/behat/basic_usage.feature +++ b/src/addons/mod/forum/tests/behat/basic_usage.feature @@ -109,7 +109,7 @@ Feature: Test basic usage of forum activity in app When I press "Initial discussion" in the app Then I should find "Reply" in the app - When I press the back button in the app + When I go back in the app And I switch network connection to offline And I press "Initial discussion" in the app And I press "Reply" in the app @@ -125,7 +125,7 @@ Feature: Test basic usage of forum activity in app And I should find "This Discussion has offline data to be synchronised" in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app And I press "Initial discussion" in the app Then I should not find "Not sent" in the app And I should not find "This Discussion has offline data to be synchronised" in the app @@ -237,7 +237,7 @@ Feature: Test basic usage of forum activity in app And I should find "Average of ratings: 1" in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app Then I should find "This Forum has offline data to be synchronised." in the app When I press "Information" in the app @@ -268,7 +268,7 @@ Feature: Test basic usage of forum activity in app And I should find "ReplyMessage" in the app And I should find "Not sent" in the app - When I press the back button in the app + When I go back in the app And I switch network connection to wifi And I press "Initial discussion" in the app Then I should find "Initial discussion message" in the app @@ -288,7 +288,7 @@ Feature: Test basic usage of forum activity in app And I should find "This Forum has offline data to be synchronised." in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app And I press "Test forum name" in the app And I press "Information" in the app And I press "Refresh" in the app @@ -327,7 +327,7 @@ Feature: Test basic usage of forum activity in app And I press "Download" within "Test forum name" "ion-item" in the app Then I should find "Downloaded" within "Test forum name" "ion-item" in the app - When I press the back button in the app + When I go back in the app And I switch network connection to offline And I press "Test forum name" in the app Then I should find "Initial discussion" in the app @@ -336,16 +336,16 @@ Feature: Test basic usage of forum activity in app Then I should find "Initial discussion" in the app And I should find "Initial discussion message" in the app - When I press the back button in the app + When I go back in the app And I press "Add discussion topic" in the app Then I should not find "There was a problem connecting to the site. Please check your connection and try again." in the app - When I press the back button in the app + When I go back in the app And I press "Sort by last post creation date in descending order" in the app And I press "Sort by last post creation date in ascending order" in the app Then I should find "Forum not available in this sorting order" in the app - When I press the back button in the app + When I go back in the app And I press "Test forum name" in the app Then I should find "Forum not available in this sorting order" in the app And I should find "Sort by last post creation date in ascending order" in the app diff --git a/src/addons/mod/forum/tests/behat/groups.feature b/src/addons/mod/forum/tests/behat/groups.feature index 394918835..8c7aba79e 100755 --- a/src/addons/mod/forum/tests/behat/groups.feature +++ b/src/addons/mod/forum/tests/behat/groups.feature @@ -46,7 +46,7 @@ Feature: Test usage of forum activity with groups in app And I should not find "Group 2" in the app When I press "Group 1" in the app - And I press the back button in the app + And I go back in the app And I press "Visible groups forum" in the app And I press "Visible groups" in the app Then I should find "All participants" in the app @@ -88,7 +88,7 @@ Feature: Test usage of forum activity with groups in app And I should find "Disc sep ALL" in the app But I should not find "Disc sep G1" in the app - When I press the back button in the app + When I go back in the app And I press "Visible groups forum" in the app And I press "Visible groups" in the app Then I should find "All participants" in the app @@ -125,7 +125,7 @@ Feature: Test usage of forum activity with groups in app Then I should find "Your post was successfully added" in the app And I should find "My happy subject" in the app - When I press the back button in the app + When I go back in the app And I press "Visible groups forum" in the app And I press "Visible groups" in the app And I press "All participants" in the app @@ -221,7 +221,7 @@ Feature: Test usage of forum activity with groups in app And I press "Group 2" in the app Then I should find "My third subject" in the app - When I press the back button in the app + When I go back in the app And I press "Visible groups forum" in the app And I press "Visible groups" in the app And I press "All participants" in the app @@ -300,7 +300,7 @@ Feature: Test usage of forum activity with groups in app And I press "Group 2" in the app Then I should find "My happy subject" in the app - When I press the back button in the app + When I go back in the app And I press "Visible groups forum" in the app And I press "Visible groups" in the app And I press "Group 1" in the app @@ -346,7 +346,7 @@ Feature: Test usage of forum activity with groups in app Then I should find "Downloaded" within "Separate groups" "ion-item" in the app And I should find "Downloaded" within "Visible groups" "ion-item" in the app - When I press the back button in the app + When I go back in the app And I switch offline mode to "true" And I press "Separate groups forum" in the app Then I should find "Disc sep G1" in the app @@ -356,8 +356,7 @@ Feature: Test usage of forum activity with groups in app Then I should find "Disc sep G1" in the app And I should find "Disc sep G1 content" in the app - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "Visible groups forum" in the app Then I should find "Disc vis ALL" in the app And I should find "Disc vis G1" in the app diff --git a/src/addons/mod/forum/tests/behat/navigation.feature b/src/addons/mod/forum/tests/behat/navigation.feature index 38fb09132..a452528b8 100644 --- a/src/addons/mod/forum/tests/behat/navigation.feature +++ b/src/addons/mod/forum/tests/behat/navigation.feature @@ -70,7 +70,7 @@ Feature: Test forum navigation Then I should find "Discussion 20 message" in the app # By creation date - When I press the back button in the app + When I go back in the app And I scroll to "Discussion 05" in the app And I press "Sort" in the app And I press "Sort by creation date in descending order" in the app @@ -101,7 +101,7 @@ Feature: Test forum navigation Then I should find "Discussion 18 message" in the app # Offline - When I press the back button in the app + When I go back in the app And I press "Add discussion topic" in the app And I switch network connection to offline And I set the following fields to these values in the app: diff --git a/src/addons/mod/glossary/tests/behat/basic_usage.feature b/src/addons/mod/glossary/tests/behat/basic_usage.feature index 95d4d181f..b11156c46 100644 --- a/src/addons/mod/glossary/tests/behat/basic_usage.feature +++ b/src/addons/mod/glossary/tests/behat/basic_usage.feature @@ -59,7 +59,7 @@ Feature: Test basic usage of glossary in app And I should find "Potato" in the app And I should find "Raddish" in the app - When I press the back button in the app + When I go back in the app And I press "Test forum name" in the app And I press "Add discussion topic" in the app And I set the field "Subject" to "Testing auto-link glossary" @@ -72,7 +72,7 @@ Feature: Test basic usage of glossary in app Then the header should be "Raddish" in the app And I should find "Raphanus sativus" in the app - When I press the back button in the app + When I go back in the app And I press "Potato" in the app Then the header should be "Potato" in the app And I should find "To make chips" in the app @@ -115,7 +115,7 @@ Feature: Test basic usage of glossary in app Given I entered the course "Course 1" as "student1" in the app When I press "Course downloads" in the app When I press "Download" within "Test glossary" "ion-item" in the app - And I press the back button in the app + And I go back in the app And I switch network connection to offline And I press "Test glossary" in the app Then the header should be "Test glossary" in the app @@ -201,7 +201,7 @@ Feature: Test basic usage of glossary in app And I should find "stub3.txt" in the app But I should not find "stub2.txt" in the app - When I press the back button in the app + When I go back in the app Then I should find "Coconut" in the app And I should find "Potato" in the app But I should not find "Cucumber" in the app @@ -257,7 +257,7 @@ Feature: Test basic usage of glossary in app But I should not find "stub2.txt" in the app And I should not find "Brassica oleracea var. italica" in the app - When I press the back button in the app + When I go back in the app Then I should find "Pickle" in the app And I should find "Potato" in the app But I should not find "Broccoli" in the app @@ -369,7 +369,7 @@ Feature: Test basic usage of glossary in app And I should find "Average of ratings: 1" in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app Then I should find "This Glossary has offline data to be synchronised." in the app When I press "Information" in the app diff --git a/src/addons/mod/glossary/tests/behat/navigation.feature b/src/addons/mod/glossary/tests/behat/navigation.feature index 4a153f7a0..bbaaccde6 100644 --- a/src/addons/mod/glossary/tests/behat/navigation.feature +++ b/src/addons/mod/glossary/tests/behat/navigation.feature @@ -114,7 +114,7 @@ Feature: Test glossary navigation Then I should find "Apricots are a fruit" in the app # By author - When I press the back button in the app + When I go back in the app And I scroll to "Acerola" in the app And I press "Browse entries" in the app And I press "Group by author" in the app @@ -143,7 +143,7 @@ Feature: Test glossary navigation Then I should find "Banana is a fruit" in the app # Search - When I press the back button in the app + When I go back in the app And I scroll to "Acerola" in the app And I press "Search" in the app And I set the field "Search query" to "something" in the app @@ -170,7 +170,7 @@ Feature: Test glossary navigation Then I should find "Watermelon is a fruit" in the app # Offline - When I press the back button in the app + When I go back in the app And I press "Clear search" in the app And I press "Add a new entry" in the app And I switch network connection to offline @@ -206,7 +206,7 @@ Feature: Test glossary navigation And I press "Save" in the app Then I should find "Tomato is a fruit" in the app - When I press the back button in the app + When I go back in the app Then I should find "Tomato" in the app And I should find "Cashew" in the app And I should find "Acerola" in the app diff --git a/src/addons/mod/lesson/tests/behat/numerical_decimal_separator.feature b/src/addons/mod/lesson/tests/behat/numerical_decimal_separator.feature index faa0bd579..66f88cc3d 100755 --- a/src/addons/mod/lesson/tests/behat/numerical_decimal_separator.feature +++ b/src/addons/mod/lesson/tests/behat/numerical_decimal_separator.feature @@ -102,7 +102,7 @@ Feature: Test decimal separators in lesson When I press "Review lesson" in the app Then the field "Your answer" matches value "2,87" in the app - When I press the back button in the app + When I go back in the app And I press "Start" in the app And I set the field "Your answer" to "2.87" in the app And I press "Submit" in the app @@ -131,7 +131,7 @@ Feature: Test decimal separators in lesson And I press "Download" within "Offline lesson" "ion-item" in the app Then I should find "Downloaded" within "Offline lesson" "ion-item" in the app - When I press the back button in the app + When I go back in the app And I press "Offline lesson" in the app And I switch network connection to offline And I press "Start" in the app @@ -153,7 +153,7 @@ Feature: Test decimal separators in lesson And I should find "Your score is 1 (out of 1)." in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app Then I should find "An offline attempt was synchronised" in the app Scenario: Attempt an offline lesson successfully as a student (custom separator) @@ -167,7 +167,7 @@ Feature: Test decimal separators in lesson And I press "Download" within "Offline lesson" "ion-item" in the app Then I should find "Downloaded" within "Offline lesson" "ion-item" in the app - When I press the back button in the app + When I go back in the app And I press "Offline lesson" in the app And I switch network connection to offline And I press "Start" in the app @@ -184,7 +184,7 @@ Feature: Test decimal separators in lesson And I should find "Your score is 1 (out of 1)." in the app When I switch network connection to wifi - And I press the back button in the app + And I go back in the app Then I should find "An offline attempt was synchronised" in the app When I switch network connection to offline diff --git a/src/addons/mod/quiz/tests/behat/basic_usage.feature b/src/addons/mod/quiz/tests/behat/basic_usage.feature index 0c6b90692..d5ddab63b 100755 --- a/src/addons/mod/quiz/tests/behat/basic_usage.feature +++ b/src/addons/mod/quiz/tests/behat/basic_usage.feature @@ -150,7 +150,7 @@ Feature: Attempt a quiz in app | \mod_quiz\event\attempt_reviewed | quiz | Quiz 1 | Course 1 | | | \mod_quiz\event\attempt_summary_viewed | quiz | Quiz 1 | Course 1 | | - When I press the back button in the app + When I go back in the app And I press "Attempt 1" in the app Then I should find "1" within "Attempt" "ion-item" in the app And I should find "Finished" within "Status" "ion-item" in the app diff --git a/src/addons/mod/quiz/tests/behat/can_review.feature b/src/addons/mod/quiz/tests/behat/can_review.feature index c7c43fdde..870be3bb2 100644 --- a/src/addons/mod/quiz/tests/behat/can_review.feature +++ b/src/addons/mod/quiz/tests/behat/can_review.feature @@ -53,35 +53,33 @@ Feature: Users can only review attempts that are allowed to be reviewed And I press "Attempt 1" in the app Then I should not be able to press "Review" in the app - When I press the back button in the app + When I go back in the app And I press "Quiz review only immed" in the app And I press "Attempt 1" in the app And I press "Review" in the app Then I should find "Question 1" in the app # Wait the "immediate after" time and check that now the behaviour is the opposite. - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I wait "120" seconds And I press "Quiz review only immed" in the app And I press "Attempt 1" in the app Then I should find "You are not allowed to review this attempt" in the app And I should not be able to press "Review" in the app - When I press the back button in the app + When I go back in the app And I press "Quiz review after immed" in the app And I press "Attempt 1" in the app And I press "Review" in the app Then I should find "Question 1" in the app - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "Quiz never review" in the app And I press "Attempt 1" in the app Then I should find "You are not allowed to review this attempt" in the app And I should not be able to press "Review" in the app - When I press the back button in the app + When I go back in the app And I press "Quiz review when closed" in the app And I press "Attempt 1" in the app Then I should find "Available 31/12/35, 23:59" in the app diff --git a/src/addons/mod/scorm/tests/behat/appearance_options.feature b/src/addons/mod/scorm/tests/behat/appearance_options.feature index 20f936ec5..1993e5a8c 100755 --- a/src/addons/mod/scorm/tests/behat/appearance_options.feature +++ b/src/addons/mod/scorm/tests/behat/appearance_options.feature @@ -33,16 +33,14 @@ Feature: Test appearance options of SCORM activity in app And I press "Disable fullscreen" in the app # Then the UI should match the snapshot - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "New window px SCORM" in the app And I press "Enter" in the app And I press "Disable fullscreen" in the app # Then the UI should match the snapshot # SCORMs with percentage sizes are displayed with full size in the app. See MOBILE-3426 for details. - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "New window perc SCORM" in the app And I press "Enter" in the app And I press "Disable fullscreen" in the app @@ -58,25 +56,23 @@ Feature: Test appearance options of SCORM activity in app When I press "No skip SCORM" in the app Then I should be able to press "Enter" in the app - When I press the back button in the app + When I go back in the app And I press "Skip first access SCORM" in the app And I press "Disable fullscreen" in the app Then I should find "2 / 11" in the app - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "Skip first access SCORM" in the app Then I should be able to press "Enter" in the app And I should not be able to press "Disable fullscreen" in the app And I should not find "3 / 11" in the app - When I press the back button in the app + When I go back in the app And I press "Always skip SCORM" in the app And I press "Disable fullscreen" in the app Then I should find "2 / 11" in the app - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "Always skip SCORM" in the app And I press "Disable fullscreen" in the app # Then I should find "3 / 11" in the app @@ -90,7 +86,7 @@ Feature: Test appearance options of SCORM activity in app When I press "SCORM without preview" in the app Then I should not be able to press "Preview" in the app - When I press the back button in the app + When I go back in the app And I press "SCORM with preview" in the app Then I should be able to press "Preview" in the app @@ -103,7 +99,7 @@ Feature: Test appearance options of SCORM activity in app When I press "SCORM without structure" in the app Then I should not find "Other Scoring Systems" in the app - When I press the back button in the app + When I go back in the app And I press "SCORM with structure" in the app Then I should find "Other Scoring Systems" in the app @@ -123,8 +119,7 @@ Feature: Test appearance options of SCORM activity in app Then I should find "Other Scoring Systems" in the app When I press "Close" in the app - And I press the back button in the app - And I press the back button in the app + And I go back 2 times in the app And I press "SCORM Hidden" in the app And I press "Enter" in the app And I press "Disable fullscreen" in the app @@ -132,8 +127,7 @@ Feature: Test appearance options of SCORM activity in app Then I should find "Other Scoring Systems" in the app When I press "Close" in the app - And I press the back button in the app - And I press the back button in the app + And I go back 2 times in the app And I press "SCORM Drop Down" in the app And I press "Enter" in the app And I press "Disable fullscreen" in the app @@ -141,8 +135,7 @@ Feature: Test appearance options of SCORM activity in app Then I should find "Other Scoring Systems" in the app When I press "Close" in the app - And I press the back button in the app - And I press the back button in the app + And I go back 2 times in the app And I press "SCORM Disabled" in the app And I press "Enter" in the app And I press "Disable fullscreen" in the app @@ -160,14 +153,14 @@ Feature: Test appearance options of SCORM activity in app When I press "SCORM no attempt status" in the app Then I should not find "Number of attempts allowed" in the app - When I press the back button in the app + When I go back in the app And I press "SCORM both att status" in the app Then I should find "Number of attempts allowed" in the app - When I press the back button in the app + When I go back in the app And I press "SCORM dashb att status" in the app Then I should find "Number of attempts allowed" in the app - When I press the back button in the app + When I go back in the app And I press "SCORM entry att status" in the app Then I should find "Number of attempts allowed" in the app diff --git a/src/addons/mod/scorm/tests/behat/attempts_and_grading.feature b/src/addons/mod/scorm/tests/behat/attempts_and_grading.feature index 966c07add..a17496139 100755 --- a/src/addons/mod/scorm/tests/behat/attempts_and_grading.feature +++ b/src/addons/mod/scorm/tests/behat/attempts_and_grading.feature @@ -42,14 +42,14 @@ Feature: Test attempts and grading settings of SCORM activity in app And I press "Next" in the app And I press "Next" in the app And I press "Next" in the app - And I press the back button in the app + And I go back in the app Then I should find "1" within "Number of attempts you have made" "ion-item" in the app And I should find "You have reached the maximum number of attempts." in the app And I should not be able to press "Enter" in the app And I should not be able to press "Preview" in the app - When I press the back button in the app + When I go back in the app And I press "SCORM 1 att no lock" in the app And I press "Enter" in the app And I press "Disable fullscreen" in the app @@ -61,7 +61,7 @@ Feature: Test attempts and grading settings of SCORM activity in app And I press "Next" in the app And I press "Next" in the app And I press "Next" in the app - And I press the back button in the app + And I go back in the app Then I should find "1" within "Number of attempts you have made" "ion-item" in the app And I should find "You have reached the maximum number of attempts." in the app And I should not find "Start a new attempt" in the app @@ -74,10 +74,10 @@ Feature: Test attempts and grading settings of SCORM activity in app # Then I should find "Review mode" in the app When I press "Close" in the app - And I press the back button in the app + And I go back in the app Then I should find "1" within "Number of attempts you have made" "ion-item" in the app - When I press the back button in the app + When I go back in the app And I press "SCORM 2 attempts" in the app And I press "Enter" in the app And I press "Disable fullscreen" in the app @@ -89,7 +89,7 @@ Feature: Test attempts and grading settings of SCORM activity in app And I press "Next" in the app And I press "Next" in the app And I press "Next" in the app - And I press the back button in the app + And I go back in the app Then I should find "1" within "Number of attempts you have made" "ion-item" in the app And I should not find "You have reached the maximum number of attempts." in the app @@ -104,12 +104,12 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I press "Next" in the app # And I press "Next" in the app # And I press "Next" in the app - # And I press the back button in the app + # And I go back in the app # Then I should find "2" within "Number of attempts you have made" "ion-item" in the app # And I should find "You have reached the maximum number of attempts." in the app # And I should not find "Start a new attempt" in the app - # When I press the back button in the app + # When I go back in the app # And I press "SCORM unlimited" in the app # Then I should find "Unlimited" within "Number of attempts allowed" "ion-item" in the app @@ -131,7 +131,7 @@ Feature: Test attempts and grading settings of SCORM activity in app And I press "Next" in the app And I press "Next" in the app And I press "Next" in the app - And I press the back button in the app + And I go back in the app Then I should find "1" within "Number of attempts you have made" "ion-item" in the app # And I should find "Start a new attempt" in the app @@ -141,7 +141,7 @@ Feature: Test attempts and grading settings of SCORM activity in app # Then I should find "Review mode" in the app When I press "Close" in the app - And I press the back button in the app + And I go back in the app Then I should find "1" within "Number of attempts you have made" "ion-item" in the app # When I press "Start a new attempt" in the app @@ -151,11 +151,11 @@ Feature: Test attempts and grading settings of SCORM activity in app # Then I should not find "Review mode" in the app # When I press "Close" in the app - # And I press the back button in the app + # And I go back in the app # Then I should find "2" within "Number of attempts you have made" "ion-item" in the app # And I should not find "Start a new attempt" in the app - # When I press the back button in the app + # When I go back in the app # When I press "SCORM when completed" in the app # And I press "Enter" in the app # And I press "Disable fullscreen" in the app @@ -167,7 +167,7 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I press "Next" in the app # And I press "Next" in the app # And I press "Next" in the app - # And I press the back button in the app + # And I go back in the app # Then I should find "1" within "Number of attempts you have made" "ion-item" in the app # And I should not find "Start a new attempt" in the app @@ -177,23 +177,23 @@ Feature: Test attempts and grading settings of SCORM activity in app # Then I should not find "Review mode" in the app # When I press "Close" in the app - # And I press the back button in the app + # And I go back in the app # Then I should find "2" within "Number of attempts you have made" "ion-item" in the app # And I should not find "Start a new attempt" in the app - # When I press the back button in the app + # When I go back in the app # When I press "SCORM always force" in the app # And I press "Enter" in the app # And I press "Disable fullscreen" in the app # And I press "Next" in the app - # And I press the back button in the app + # And I go back in the app # Then I should find "1" within "Number of attempts you have made" "ion-item" in the app # And I should not find "Start a new attempt" in the app # When I press "Enter" in the app # And I press "Disable fullscreen" in the app # And I press "Next" in the app - # And I press the back button in the app + # And I go back in the app # Then I should find "2" within "Number of attempts you have made" "ion-item" in the app # And I should not find "Start a new attempt" in the app @@ -293,12 +293,12 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I should find "Completed" within "SCO with prerequisite (first and secon SCO)" "ion-item" in the app # When I press "Close" in the app -# And I press the back button in the app +# And I go back in the app # Then I should find "5" within "Grade reported" "ion-item" in the app # And I should find "Score: 8" within "The first content (one SCO)" "ion-item" in the app # # Case 2: SCORM with highest grade as grading method -# When I press the back button in the app +# When I go back in the app # And I press "SCORM highest" in the app # And I press "Enter" in the app # And I press "Disable fullscreen" in the app @@ -372,11 +372,11 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I click on "#ui-id-25" "css_element" # And I press "Commit changes" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # Then I should find "10" within "Grade reported" "ion-item" in the app # # Case 3: SCORM with average grade as grading method -# When I press the back button in the app +# When I go back in the app # And I press "SCORM average" in the app # And I press "Enter" in the app # And I press "Disable fullscreen" in the app @@ -450,11 +450,11 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I click on "#ui-id-25" "css_element" # And I press "Commit changes" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # Then I should find "6.17%" within "Grade reported" "ion-item" in the app # # Case 4: SCORM with sum grade as grading method and a max grade of 100 -# When I press the back button in the app +# When I go back in the app # And I press "SCORM sum 100" in the app # And I press "Enter" in the app # And I press "Disable fullscreen" in the app @@ -528,11 +528,11 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I click on "#ui-id-25" "css_element" # And I press "Commit changes" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # Then I should find "37%" within "Grade reported" "ion-item" in the app # # Case 5: SCORM with sum grade as grading method and a max grade of 50 -# When I press the back button in the app +# When I go back in the app # And I press "SCORM sum 50" in the app # And I press "Enter" in the app # And I press "Disable fullscreen" in the app @@ -606,7 +606,7 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I click on "#ui-id-25" "css_element" # And I press "Commit changes" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # Then I should find "74%" within "Grade reported" "ion-item" in the app # Scenario: SCORM grade is calculated right based on 'Attempts grading' setting @@ -653,7 +653,7 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I switch to "scorm_object" iframe # And I press "Exit" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # And I press "Grades" in the app # Then I should find "27%" within "Grade reported" "ion-item" in the app # And I should find "27%" within "Grade for attempt 1" "ion-item" in the app @@ -691,7 +691,7 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I switch to "scorm_object" iframe # And I press "Exit" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # Then I should find "40%" within "Grade reported" "ion-item" in the app # And I should find "27%" within "Grade for attempt 1" "ion-item" in the app # And I should find "40%" within "Grade for attempt 2" "ion-item" in the app @@ -726,14 +726,14 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I switch to "scorm_object" iframe # And I press "Exit" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # Then I should find "40%" within "Grade reported" "ion-item" in the app # And I should find "27%" within "Grade for attempt 1" "ion-item" in the app # And I should find "40%" within "Grade for attempt 2" "ion-item" in the app # And I should find "20%" within "Grade for attempt 3" "ion-item" in the app # # Case 2: perform 2 attempts in 'SCORM average' and check the average grade is used. -# When I press the back button in the app +# When I go back in the app # And I press "SCORM average" in the app # Then I should find "Average attempts" within "Grading method" "ion-item" in the app # And I should find "Grade couldn't be calculated" within "Grade reported" "ion-item" in the app @@ -767,7 +767,7 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I switch to "scorm_object" iframe # And I press "Exit" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # And I press "Grades" in the app # Then I should find "20%" within "Grade reported" "ion-item" in the app # And I should find "20%" within "Grade for attempt 1" "ion-item" in the app @@ -805,13 +805,13 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I switch to "scorm_object" iframe # And I press "Exit" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # Then I should find "30%" within "Grade reported" "ion-item" in the app # And I should find "20%" within "Grade for attempt 1" "ion-item" in the app # And I should find "40%" within "Grade for attempt 2" "ion-item" in the app # # Case 3: perform 2 attempts in 'SCORM first' and check the first attempt is used. -# When I press the back button in the app +# When I go back in the app # And I press "SCORM first" in the app # Then I should find "First attempt" within "Grading method" "ion-item" in the app # And I should find "Grade couldn't be calculated" within "Grade reported" "ion-item" in the app @@ -846,7 +846,7 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I switch to "scorm_object" iframe # And I press "Exit" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # And I press "Grades" in the app # Then I should find "27%" within "Grade reported" "ion-item" in the app # And I should find "27%" within "Grade for attempt 1" "ion-item" in the app @@ -884,13 +884,13 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I switch to "scorm_object" iframe # And I press "Exit" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # Then I should find "27%" within "Grade reported" "ion-item" in the app # And I should find "27%" within "Grade for attempt 1" "ion-item" in the app # And I should find "40%" within "Grade for attempt 2" "ion-item" in the app # # Case 4: perform 3 attempts in 'SCORM last' and check the last completed attempt is used. -# When I press the back button in the app +# When I go back in the app # And I press "SCORM last" in the app # Then I should find "Last completed attempt" within "Grading method" "ion-item" in the app # And I should find "Grade couldn't be calculated" within "Grade reported" "ion-item" in the app @@ -935,7 +935,7 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I switch to "scorm_object" iframe # And I press "Exit" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # And I press "Grades" in the app # Then I should find "87%" within "Grade reported" "ion-item" in the app # And I should find "87%" within "Grade for attempt 1" "ion-item" in the app @@ -971,7 +971,7 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I switch to "scorm_object" iframe # And I press "Exit" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # # Grade reported belongs to attempt 1 because the second attempt's only SCO is failed. # Then I should find "87%" within "Grade reported" "ion-item" in the app # And I should find "87%" within "Grade for attempt 1" "ion-item" in the app @@ -1016,7 +1016,7 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I switch to "scorm_object" iframe # And I press "Exit" # And I switch to the main frame -# And I press the back button in the app +# And I go back in the app # Then I should find "73%" within "Grade reported" "ion-item" in the app # And I should find "87%" within "Grade for attempt 1" "ion-item" in the app # And I should find "27%" within "Grade for attempt 2" "ion-item" in the app diff --git a/src/addons/mod/scorm/tests/behat/availability.feature b/src/addons/mod/scorm/tests/behat/availability.feature index 00e9a47bf..44af9660c 100755 --- a/src/addons/mod/scorm/tests/behat/availability.feature +++ b/src/addons/mod/scorm/tests/behat/availability.feature @@ -28,13 +28,13 @@ Feature: Test availability options of SCORM activity in app And I should find "## yesterday ##%d %B %Y, %I:%M %p##" near "Closed:" in the app And I should not be able to press "Enter" in the app - When I press the back button in the app + When I go back in the app And I press "Current SCORM" in the app Then I should find "## yesterday ##%d %B %Y, %I:%M %p##" near "Opened:" in the app And I should find "## tomorrow ##%d %B %Y, %I:%M %p##" near "Closes:" in the app And I should be able to press "Enter" in the app - When I press the back button in the app + When I go back in the app And I press "Future SCORM" in the app Then I should find "Sorry, this activity is not available until ## tomorrow ##%A, %d %B %Y, %I:%M %p##" in the app And I should find "## tomorrow ##%d %B %Y, %I:%M %p##" near "Opens:" in the app diff --git a/src/addons/mod/scorm/tests/behat/basic_usage.feature b/src/addons/mod/scorm/tests/behat/basic_usage.feature index 9ed1be36b..df8bd4c4f 100755 --- a/src/addons/mod/scorm/tests/behat/basic_usage.feature +++ b/src/addons/mod/scorm/tests/behat/basic_usage.feature @@ -40,7 +40,7 @@ Feature: Test basic usage of SCORM activity in app # And I should see "Scoring" # When I switch to the main frame -# And I press the back button in the app +# And I go back in the app # Then I should find "1" within "Number of attempts you have made" "ion-item" in the app # And I should find "3" within "Grade reported" "ion-item" in the app @@ -103,7 +103,7 @@ Feature: Test basic usage of SCORM activity in app # And I should find "Not attempted" within "Having Fun Quiz" "ion-item" in the app # When I press "Close" in the app - # And I press the back button in the app + # And I go back in the app # Then I should find "Completed" within "How to Play" "ion-item" in the app # And I should find "Completed" within "Par?" "ion-item" in the app # And I should find "Not attempted" within "Keeping Score" "ion-item" in the app @@ -143,7 +143,7 @@ Feature: Test basic usage of SCORM activity in app And I press "Next" in the app Then I should find "11 / 11" in the app - When I press the back button in the app + When I go back in the app Then I should find "1" within "Number of attempts you have made" "ion-item" in the app # And I should find "9" within "Grade reported" "ion-item" in the app @@ -156,7 +156,7 @@ Feature: Test basic usage of SCORM activity in app # And I should find "Complete" within "Having Fun Quiz" "ion-item" in the app # When I press "Close" in the app - # And I press the back button in the app + # And I go back in the app # Then I should find "1" within "Number of attempts you have made" "ion-item" in the app Scenario: Unsupported SCORM diff --git a/src/addons/mod/survey/tests/behat/basic_usage.feature b/src/addons/mod/survey/tests/behat/basic_usage.feature index e30cf866b..894f90f37 100755 --- a/src/addons/mod/survey/tests/behat/basic_usage.feature +++ b/src/addons/mod/survey/tests/behat/basic_usage.feature @@ -245,7 +245,7 @@ Feature: Test basic usage of survey activity in app Then I should see "This Survey has offline data to be synchronised." When I switch network connection to wifi - And I press the back button in the app + And I go back in the app And I press "Test survey critical incidents" in the app And I press "Information" in the app And I press "Refresh" in the app @@ -260,13 +260,13 @@ Feature: Test basic usage of survey activity in app Given I entered the course "Course 1" as "student1" in the app And I press "Course downloads" in the app And I press "Download" within "Test survey critical incidents" "ion-item" in the app - And I press the back button in the app + And I go back in the app And I switch network connection to offline And I press "Test survey name" in the app Then I should see "There was a problem connecting to the site. Please check your connection and try again." When I press "OK" in the app - And I press the back button in the app + And I go back in the app And I press "Test survey critical incidents" in the app And I press "Submit" in the app And I press "OK" in the app diff --git a/src/addons/mod/workshop/tests/behat/basic_usage.feature b/src/addons/mod/workshop/tests/behat/basic_usage.feature index c9c7e07b5..06441f66d 100644 --- a/src/addons/mod/workshop/tests/behat/basic_usage.feature +++ b/src/addons/mod/workshop/tests/behat/basic_usage.feature @@ -134,5 +134,5 @@ Feature: Test basic usage of workshop activity in app When I press "Information" in the app And I press "Download" in the app And I press "Close" in the app - And I press the back button in the app + And I go back in the app Then I should find "Downloaded" in the app diff --git a/src/addons/notifications/tests/behat/notifications.feature b/src/addons/notifications/tests/behat/notifications.feature index f5e17deb6..c70e7e976 100644 --- a/src/addons/notifications/tests/behat/notifications.feature +++ b/src/addons/notifications/tests/behat/notifications.feature @@ -59,12 +59,12 @@ Feature: Notifications Then I should find "Push 01" in the app # Open notification detail - When I press the back button in the app + When I go back in the app And I press "Test 30" in the app Then I should find "Test 30 description" in the app # Go back and open other notification - When I press the back button in the app + When I go back in the app Then I should find "Test 10" in the app When I press "Test 10" in the app Then I should find "Test 10 description" in the app diff --git a/src/core/features/comments/tests/behat/basic_usage.feature b/src/core/features/comments/tests/behat/basic_usage.feature index 2af2285ae..fcfd1e16d 100644 --- a/src/core/features/comments/tests/behat/basic_usage.feature +++ b/src/core/features/comments/tests/behat/basic_usage.feature @@ -41,7 +41,7 @@ Feature: Test basic usage of comments in app Then I should find "Comment created" in the app And I should find "comment test teacher" in the app - When I press the back button in the app + When I go back in the app And I should find "Comments (1)" in the app # Create and delete comments as a student @@ -55,7 +55,7 @@ Feature: Test basic usage of comments in app And I should find "comment test teacher" in the app And I should find "comment test student" in the app - When I press the back button in the app + When I go back in the app And I press "Comments (2)" in the app And I press "Toggle delete buttons" in the app And I press "Delete" near "comment test student" in the app @@ -64,7 +64,7 @@ Feature: Test basic usage of comments in app And I should find "comment test teacher" in the app But I should not see "comment test student" - When I press the back button in the app + When I go back in the app Then I should find "Comments (1)" in the app Scenario: Add comments offline & Delete comments offline & Sync comments (database) @@ -82,7 +82,7 @@ Feature: Test basic usage of comments in app And I should find "There are offline comments to be synchronised." in the app And I should find "comment test" in the app - When I press the back button in the app + When I go back in the app And I press "Comments (0)" in the app And I switch network connection to wifi And I press "Display options" in the app @@ -91,7 +91,7 @@ Feature: Test basic usage of comments in app Then I should find "comment test" in the app But I should not see "There are offline comments to be synchronised." - When I press the back button in the app + When I go back in the app And I press "Comments (1)" in the app And I switch network connection to offline And I press "Toggle delete buttons" in the app @@ -102,7 +102,7 @@ Feature: Test basic usage of comments in app And I should find "Deleted offline" in the app And I should find "comment test" in the app - When I press the back button in the app + When I go back in the app And I press "Comments (1)" in the app And I switch network connection to wifi And I press "Display options" in the app @@ -111,7 +111,7 @@ Feature: Test basic usage of comments in app Then I should not see "There are offline comments to be synchronised." And I should not see "comment test" - When I press the back button in the app + When I go back in the app And I should find "Comments (0)" in the app Scenario: Add comments & delete comments (glossary) @@ -128,7 +128,7 @@ Feature: Test basic usage of comments in app And I press "Send" in the app Then I should find "Comment created" in the app And I should find "comment test teacher" in the app - And I press the back button in the app + And I go back in the app And I should find "Comments (1)" in the app # Create and delete comments as a student @@ -142,7 +142,7 @@ Feature: Test basic usage of comments in app And I should find "comment test teacher" in the app And I should find "comment test student" in the app - When I press the back button in the app + When I go back in the app And I press "Comments (2)" in the app And I press "Toggle delete buttons" in the app And I press "Delete" near "comment test student" in the app @@ -151,7 +151,7 @@ Feature: Test basic usage of comments in app And I should find "comment test teacher" in the app But I should not see "comment test student" - When I press the back button in the app + When I go back in the app And I should find "Comments (1)" in the app Scenario: Add comments offline & Delete comments offline & Sync comments (glossary) @@ -170,7 +170,7 @@ Feature: Test basic usage of comments in app And I should find "There are offline comments to be synchronised." in the app And I should find "comment test" in the app - When I press the back button in the app + When I go back in the app And I press "Comments (0)" in the app And I switch network connection to wifi And I press "Display options" in the app @@ -179,7 +179,7 @@ Feature: Test basic usage of comments in app Then I should find "comment test" in the app But I should not see "There are offline comments to be synchronised." - When I press the back button in the app + When I go back in the app And I press "Comments (1)" in the app And I switch network connection to offline And I press "Toggle delete buttons" in the app @@ -190,7 +190,7 @@ Feature: Test basic usage of comments in app And I should find "Deleted offline" in the app And I should find "comment test" in the app - When I press the back button in the app + When I go back in the app And I press "Comments (1)" in the app And I switch network connection to wifi And I press "Display options" in the app @@ -199,7 +199,7 @@ Feature: Test basic usage of comments in app Then I should not see "There are offline comments to be synchronised." And I should not see "comment test" - When I press the back button in the app + When I go back in the app And I should find "Comments (0)" in the app Scenario: Add comments & Delete comments (blogs) @@ -221,7 +221,7 @@ Feature: Test basic usage of comments in app Then I should find "Comment created" in the app And I should find "comment test" in the app - When I press the back button in the app + When I go back in the app And I press "Comments (1)" in the app And I press "Toggle delete buttons" in the app And I press "Delete" in the app @@ -229,7 +229,7 @@ Feature: Test basic usage of comments in app Then I should find "Comment deleted" in the app But I should not see "comment test" - When I press the back button in the app + When I go back in the app Then I should find "Comments (0)" in the app Scenario: Add comments offline & Delete comments offline & Sync comments (blogs) @@ -253,7 +253,7 @@ Feature: Test basic usage of comments in app And I should find "There are offline comments to be synchronised." in the app And I should find "comment test" in the app - When I press the back button in the app + When I go back in the app And I press "Comments (0)" in the app And I switch network connection to wifi And I press "Display options" in the app @@ -262,7 +262,7 @@ Feature: Test basic usage of comments in app Then I should find "comment test" in the app But I should not see "There are offline comments to be synchronised." - When I press the back button in the app + When I go back in the app And I press "Comments (1)" in the app And I switch network connection to offline And I press "Toggle delete buttons" in the app @@ -273,7 +273,7 @@ Feature: Test basic usage of comments in app And I should find "Deleted offline" in the app And I should find "comment test" in the app - When I press the back button in the app + When I go back in the app And I press "Comments (1)" in the app And I switch network connection to wifi And I press "Display options" in the app @@ -282,5 +282,5 @@ Feature: Test basic usage of comments in app Then I should not see "There are offline comments to be synchronised." And I should not see "comment test" - When I press the back button in the app + When I go back in the app Then I should find "Comments (0)" in the app diff --git a/src/core/features/course/tests/behat/basic_usage-403.feature b/src/core/features/course/tests/behat/basic_usage-403.feature index 97435b80e..14deebbbb 100644 --- a/src/core/features/course/tests/behat/basic_usage-403.feature +++ b/src/core/features/course/tests/behat/basic_usage-403.feature @@ -119,11 +119,11 @@ Feature: Test basic usage of one course in app When I press "Test forum name" in the app Then the header should be "Test forum name" in the app - When I press the back button in the app + When I go back in the app And I press "Test wiki name" in the app Then the header should be "Test wiki name" in the app - When I press the back button in the app + When I go back in the app And I press "Course index" in the app And I press "Topic 1" in the app Then I should find "Choice course 1" in the app @@ -144,19 +144,19 @@ Feature: Test basic usage of one course in app When I press "Choice course 1" in the app Then the header should be "Choice course 1" in the app - When I press the back button in the app + When I go back in the app And I press "assignment" in the app Then the header should be "assignment" in the app - When I press the back button in the app + When I go back in the app And I press "Test external name" in the app Then the header should be "Test external name" in the app - When I press the back button in the app + When I go back in the app And I press "Test survey name" in the app Then the header should be "Test survey name" in the app - When I press the back button in the app + When I go back in the app And I press "Course index" in the app And I press "Topic 2" in the app Then I should find "Quiz 1" in the app @@ -177,15 +177,15 @@ Feature: Test basic usage of one course in app When I press "Test chat name" in the app Then the header should be "Test chat name" in the app - When I press the back button in the app + When I go back in the app And I press "Quiz 1" in the app Then the header should be "Quiz 1" in the app - When I press the back button in the app + When I go back in the app And I press "Test scorm name" in the app Then the header should be "Test scorm name" in the app - When I press the back button in the app + When I go back in the app And I press "Course index" in the app And I press "Topic 3" in the app Then I should find "Test feedback name" in the app @@ -207,15 +207,15 @@ Feature: Test basic usage of one course in app And I press "OK" in the app Then the header should be "Test feedback name" in the app - When I press the back button in the app + When I go back in the app And I press "Test lesson name" in the app Then the header should be "Test lesson name" in the app - When I press the back button in the app + When I go back in the app And I press "Test workshop name" in the app Then the header should be "Test workshop name" in the app - When I press the back button in the app + When I go back in the app And I press "Course index" in the app And I press "Topic 4" in the app Then I should find "Web links" in the app @@ -236,7 +236,7 @@ Feature: Test basic usage of one course in app When I press "Web links" in the app Then the header should be "Web links" in the app - When I press the back button in the app + When I go back in the app And I press "Course index" in the app And I press "Topic 5" in the app Then I should find "Test glossary" in the app diff --git a/src/core/features/course/tests/behat/basic_usage.feature b/src/core/features/course/tests/behat/basic_usage.feature index 04ac75b4c..d6252b9a8 100755 --- a/src/core/features/course/tests/behat/basic_usage.feature +++ b/src/core/features/course/tests/behat/basic_usage.feature @@ -127,57 +127,57 @@ Feature: Test basic usage of one course in app When I press "Choice course 1" in the app Then the header should be "Choice course 1" in the app - When I press the back button in the app + When I go back in the app And I press "assignment" in the app Then the header should be "assignment" in the app - When I press the back button in the app + When I go back in the app And I press "Test forum name" in the app Then the header should be "Test forum name" in the app - When I press the back button in the app + When I go back in the app And I press "Test chat name" in the app Then the header should be "Test chat name" in the app - When I press the back button in the app + When I go back in the app And I press "Web links" in the app Then the header should be "Web links" in the app - When I press the back button in the app + When I go back in the app And I press "Test external name" in the app And I press "Launch the activity" in the app And I wait loading to finish in the app Then the header should be "Test external name" in the app - When I press the back button in the app + When I go back in the app And I press "Test feedback name" in the app Then the header should be "Test feedback name" in the app - When I press the back button in the app + When I go back in the app And I press "Test glossary" in the app Then the header should be "Test glossary" in the app - When I press the back button in the app + When I go back in the app And I press "Quiz 1" in the app Then the header should be "Quiz 1" in the app - When I press the back button in the app + When I go back in the app And I press "Test survey name" in the app Then the header should be "Test survey name" in the app - When I press the back button in the app + When I go back in the app And I press "Test wiki name" in the app Then the header should be "Test wiki name" in the app - When I press the back button in the app + When I go back in the app And I press "Test lesson name" in the app Then the header should be "Test lesson name" in the app - When I press the back button in the app + When I go back in the app And I press "Test scorm name" in the app Then the header should be "Test scorm name" in the app - When I press the back button in the app + When I go back in the app And I press "Test workshop name" in the app Then the header should be "Test workshop name" in the app And the following events should have been logged for "student1" in the app: @@ -237,11 +237,11 @@ Feature: Test basic usage of one course in app When I press "Test forum name" in the app Then the header should be "Test forum name" in the app - When I press the back button in the app + When I go back in the app And I press "Test wiki name" in the app Then the header should be "Test wiki name" in the app - When I press the back button in the app + When I go back in the app And I press "Course index" in the app And I press "Section 1" in the app Then I should find "Choice course 1" in the app @@ -262,19 +262,19 @@ Feature: Test basic usage of one course in app When I press "Choice course 1" in the app Then the header should be "Choice course 1" in the app - When I press the back button in the app + When I go back in the app And I press "assignment" in the app Then the header should be "assignment" in the app - When I press the back button in the app + When I go back in the app And I press "Test external name" in the app Then the header should be "Test external name" in the app - When I press the back button in the app + When I go back in the app And I press "Test survey name" in the app Then the header should be "Test survey name" in the app - When I press the back button in the app + When I go back in the app And I press "Course index" in the app And I press "Section 2" in the app Then I should find "Quiz 1" in the app @@ -295,15 +295,15 @@ Feature: Test basic usage of one course in app When I press "Test chat name" in the app Then the header should be "Test chat name" in the app - When I press the back button in the app + When I go back in the app And I press "Quiz 1" in the app Then the header should be "Quiz 1" in the app - When I press the back button in the app + When I go back in the app And I press "Test scorm name" in the app Then the header should be "Test scorm name" in the app - When I press the back button in the app + When I go back in the app And I press "Course index" in the app And I press "Section 3" in the app Then I should find "Test feedback name" in the app @@ -324,15 +324,15 @@ Feature: Test basic usage of one course in app When I press "Test feedback name" in the app Then the header should be "Test feedback name" in the app - When I press the back button in the app + When I go back in the app And I press "Test lesson name" in the app Then the header should be "Test lesson name" in the app - When I press the back button in the app + When I go back in the app And I press "Test workshop name" in the app Then the header should be "Test workshop name" in the app - When I press the back button in the app + When I go back in the app And I press "Course index" in the app And I press "Section 4" in the app Then I should find "Web links" in the app @@ -353,7 +353,7 @@ Feature: Test basic usage of one course in app When I press "Web links" in the app Then the header should be "Web links" in the app - When I press the back button in the app + When I go back in the app And I press "Course index" in the app And I press "Section 5" in the app Then I should find "Test glossary" in the app diff --git a/src/core/features/courses/tests/behat/basic-usage-402.feature b/src/core/features/courses/tests/behat/basic-usage-402.feature index 4e6fc5b9d..d31efea9b 100644 --- a/src/core/features/courses/tests/behat/basic-usage-402.feature +++ b/src/core/features/courses/tests/behat/basic-usage-402.feature @@ -54,13 +54,12 @@ Feature: Test basic usage of courses in app Then I should find "Test choice description" in the app And the header should be "Choice course 1" in the app - When I press the back button in the app - And I press the back button in the app + When I go back to the root page 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 + When I go back 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 diff --git a/src/core/features/courses/tests/behat/basic_usage.feature b/src/core/features/courses/tests/behat/basic_usage.feature index 860d27def..aee18854b 100755 --- a/src/core/features/courses/tests/behat/basic_usage.feature +++ b/src/core/features/courses/tests/behat/basic_usage.feature @@ -81,13 +81,12 @@ Feature: Test basic usage of courses in app Then I should find "Test choice description" in the app And the header should be "Choice course 1" in the app - When I press the back button in the app - And I press the back button in the app + When I go back to the root page 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 + When I go back 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 +107,7 @@ Feature: Test basic usage of courses in app Then I should find "Course 4" in the app And I should find "Course summary" in the app - When I press the back button in the app + When I go back in the app And I set the field "Search" to "Course" in the app And I press "Search" "button" in the app Then I should find "Course 1" in the app @@ -128,8 +127,7 @@ Feature: Test basic usage of courses in app When I press "Add submission" in the app Then I should find "Online text submissions" in the app - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "Add submission" in the app Then I should find "Online text submissions" in the app diff --git a/src/core/features/grades/tests/behat/navigation.feature b/src/core/features/grades/tests/behat/navigation.feature index 8182ee7f1..7f1d2a386 100644 --- a/src/core/features/grades/tests/behat/navigation.feature +++ b/src/core/features/grades/tests/behat/navigation.feature @@ -83,14 +83,13 @@ Feature: Grades navigation Then I should find "Blog entries" in the app And I should find "Grades" in the app - When I press the back button in the app + When I go back in the app And I press "Student second" in the app Then I should find "Blog entries" in the app But I should not find "Grades" in the app # User grades - When I press the back button in the app - And I press the back button in the app + When I go back to the root page in the app And I press the user menu button in the app And I press "Grades" in the app Then the header should be "Grades" in the app @@ -148,7 +147,7 @@ Feature: Grades navigation Then I should find "Course 1" in the app But I should not find "Course 2" in the app - When I press the back button in the app + When I go back in the app Then I should find "Course 1" in the app And I should find "Course 2" in the app And the following events should have been logged for "student1" in the app: @@ -212,7 +211,7 @@ Feature: Grades navigation And I should not find "Percentage" in the app # Profile grades - When I press the back button in the app + When I go back in the app And I press "Participants" in the app And I press "Student first" in the app And I press "Grades" in the app diff --git a/src/core/features/grades/tests/behat/view.feature b/src/core/features/grades/tests/behat/view.feature index bdab98ba5..825eb2a10 100644 --- a/src/core/features/grades/tests/behat/view.feature +++ b/src/core/features/grades/tests/behat/view.feature @@ -53,13 +53,13 @@ Feature: View grades Then I should find "80" within "Gradebook" "ion-list" in the app When I press "Close" in the app - And I press the back button in the app + And I go back in the app And I press "Assignment 2" in the app And I press "Information" in the app Then I should find "35" within "Gradebook" "ion-list" in the app When I press "Close" in the app - And I press the back button in the app + And I go back in the app And I press "Grades" in the app Then I should find "Category 1" in the app And I should find "70" within "Item 1.1" "tr" in the app diff --git a/src/core/features/login/tests/behat/showloginform_setting.feature b/src/core/features/login/tests/behat/showloginform_setting.feature index 56a02a978..7da2d8b77 100644 --- a/src/core/features/login/tests/behat/showloginform_setting.feature +++ b/src/core/features/login/tests/behat/showloginform_setting.feature @@ -36,10 +36,7 @@ Feature: Test showloginform setting in the app And I press "Moodle Mobile" in the app And I press "Developer options" in the app And I press "Always show login form" in the app - And I press the back button in the app - And I press the back button in the app - And I press the back button in the app - And I press the back button in the app + And I go back 4 times in the app Then the header should be "Log in" in the app And I should find "Log in" "ion-button" in the app @@ -51,10 +48,7 @@ Feature: Test showloginform setting in the app And I press "Moodle Mobile" in the app And I press "Developer options" in the app And I press "Always show login form" in the app - And I press the back button in the app - And I press the back button in the app - And I press the back button in the app - And I press the back button in the app + And I go back 4 times in the app And I press "david student" in the app Then the header should be "Reconnect" in the app And I should find "Log in" "ion-button" in the app diff --git a/src/core/features/policy/tests/behat/consent.feature b/src/core/features/policy/tests/behat/consent.feature index b95dc091a..ac20fd012 100755 --- a/src/core/features/policy/tests/behat/consent.feature +++ b/src/core/features/policy/tests/behat/consent.feature @@ -153,7 +153,7 @@ Feature: Test accepting pending policies on signup But I should not find "Accepted" in the app # Test tablet view now. - When I press the back button in the app + When I go back in the app And I change viewport size to "1200x640" in the app And I press "User account" in the app And I press "Policies and agreements" in the app diff --git a/src/core/features/search/tests/behat/global-search.feature b/src/core/features/search/tests/behat/global-search.feature index 4f0892926..ac7a1d147 100644 --- a/src/core/features/search/tests/behat/global-search.feature +++ b/src/core/features/search/tests/behat/global-search.feature @@ -75,7 +75,7 @@ Feature: Test Global Search When I press "Test page 01" in the app Then I should find "Test page content" in the app - When I press the back button in the app + When I go back in the app And global search expects the query "forum" and will return: | type | idnumber | | activity | forum | @@ -87,7 +87,7 @@ Feature: Test Global Search When I press "Test forum" in the app Then I should find "Test forum intro" in the app - When I press the back button in the app + When I go back in the app And I press "Clear search" in the app Then I should find "What are you searching for?" in the app But I should not find "Test forum" in the app diff --git a/src/core/features/settings/tests/behat/settings_navigation.feature b/src/core/features/settings/tests/behat/settings_navigation.feature index 4b7d8ef0c..95eedc923 100644 --- a/src/core/features/settings/tests/behat/settings_navigation.feature +++ b/src/core/features/settings/tests/behat/settings_navigation.feature @@ -10,7 +10,7 @@ Feature: It navigates properly within settings. Given I entered the app as "student1" # Settings - When I press "More" in the app + When I press the more menu button in the app And I press "App settings" in the app Then I should find "General" in the app And I should find "Space usage" in the app @@ -22,14 +22,13 @@ Feature: It navigates properly within settings. Then I should find "Language" in the app And I should find "Text size" in the app - When I press the back button in the app + When I go back in the app And I press "About" in the app Then I should find "Moodle Mobile" in the app And I should find "Privacy policy" in the app # Preferences - When I press the back button in the app - And I press the back button in the app + When I go back to the root page in the app And I press the user menu button in the app And I press "Preferences" in the app Then I should find "Messages" in the app @@ -41,7 +40,7 @@ Feature: It navigates properly within settings. Then I should find "Accept messages from" in the app And I should find "Notification preferences" in the app - When I press the back button in the app + When I go back in the app And I press "Manage downloads" in the app Then I should find "Total space used" in the app @@ -50,7 +49,7 @@ Feature: It navigates properly within settings. And I change viewport size to "1200x640" in the app # Settings - When I press "More" in the app + When I press the more menu button in the app And I press "App settings" in the app Then I should find "General" in the app And I should find "Space usage" in the app diff --git a/src/core/features/settings/tests/behat/sync.feature b/src/core/features/settings/tests/behat/sync.feature index 4f577f419..22020eec2 100644 --- a/src/core/features/settings/tests/behat/sync.feature +++ b/src/core/features/settings/tests/behat/sync.feature @@ -27,8 +27,7 @@ Feature: It synchronise sites properly Then I should find "This Choice has offline data to be synchronised." in the app # Cannot sync in offline - When I press the back button in the app - And I press the back button in the app + When I go back to the root page in the app And I press the user menu button in the app And I press "Preferences" in the app Then I should find "Your device is offline. Connect to the internet to synchronise sites." in the app @@ -43,15 +42,14 @@ Feature: It synchronise sites properly Then I should find "Site synchronisation completed" in the app When I switch network connection to offline - And I press the back button in the app + And I go back in the app And I entered the course "Course 1" in the app And I press "Sync choice" in the app Then I should not find "This Choice has offline data to be synchronised." in the app # Check limited sync. When I switch network connection to cellular - And I press the back button in the app - And I press the back button in the app + And I go back to the root page in the app And I press the user menu button in the app And I press "Preferences" in the app @@ -104,7 +102,8 @@ Feature: It synchronise sites properly Scenario: Sync logged in and logged out sites Given I entered the app as "student1" And I log out in the app - And I entered the choice activity "Sync choice" on course "Course 1" as "student2" in the app + And I entered the course "Course 1" as "student2" in the app + And I press "Sync choice" in the app # Add something offline When I switch network connection to offline @@ -113,8 +112,7 @@ Feature: It synchronise sites properly And I press "OK" in the app Then I should find "This Choice has offline data to be synchronised." in the app - When I press the back button in the app - And I press the back button in the app + When I go back to the root page in the app And I press the more menu button in the app And I press "App settings" in the app And I press "Synchronisation" in the app @@ -125,14 +123,13 @@ Feature: It synchronise sites properly When I press "Synchronise now" "button" in the app And I wait loading to finish in the app And I switch network connection to offline - And I press the back button in the app + And I go back in the app And I entered the course "Course 1" in the app And I press "Sync choice" in the app Then I should not find "This Choice has offline data to be synchronised." in the app # Test log in to sync - When I press the back button in the app - And I press the back button in the app + When I go back to the root page in the app And I press the more menu button in the app And I press "App settings" in the app And I press "Synchronisation" in the app diff --git a/src/core/features/user/tests/behat/basic_usage.feature b/src/core/features/user/tests/behat/basic_usage.feature index b64ebbb97..de348fb43 100755 --- a/src/core/features/user/tests/behat/basic_usage.feature +++ b/src/core/features/user/tests/behat/basic_usage.feature @@ -103,8 +103,7 @@ Feature: Test basic usage of user features Then I should find "Europe/Madrid" in the app And I should not find "Asia/Shanghai" in the app - When I press the back button in the app - And I press the back button in the app + When I go back 2 times in the app And I press "John Smith" in the app And I press "Details" in the app Then I should find "Asia/Shanghai" in the app diff --git a/src/core/features/usertours/tests/behat/usertours.feature b/src/core/features/usertours/tests/behat/usertours.feature index b39b4f852..b6bef8c13 100644 --- a/src/core/features/usertours/tests/behat/usertours.feature +++ b/src/core/features/usertours/tests/behat/usertours.feature @@ -42,6 +42,6 @@ Feature: User Tours work properly. When I press "Got it" in the app Then I should not find "Swipe left and right to navigate around" in the app - When I press the back button in the app + When I go back in the app And I press "Student First" in the app Then I should not find "Swipe left and right to navigate around" in the app diff --git a/src/core/tests/behat/navigation_activities.feature b/src/core/tests/behat/navigation_activities.feature index 53d4acba5..faee152a3 100644 --- a/src/core/tests/behat/navigation_activities.feature +++ b/src/core/tests/behat/navigation_activities.feature @@ -23,8 +23,8 @@ Feature: It navigates properly within activities. And I press "Go to label" in the app Then I should find "Label description" in the app - When I press the back button in the app + When I go back in the app Then I should find "Go to label" in the app - When I press the back button in the app + When I go back in the app Then I should find "Label description" in the app diff --git a/src/core/tests/behat/navigation_deeplinks.feature b/src/core/tests/behat/navigation_deeplinks.feature index 80fc81280..41bd254c2 100644 --- a/src/core/tests/behat/navigation_deeplinks.feature +++ b/src/core/tests/behat/navigation_deeplinks.feature @@ -42,7 +42,7 @@ Feature: It navigates properly using deep links. And I should find "Forum message" in the app But I should not find "Site home" in the app - When I press the back button in the app + When I go back in the app Then I should find "Site home" in the app But I should not find "Forum topic" in the app And I should not find "Forum message" in the app @@ -58,7 +58,7 @@ Feature: It navigates properly using deep links. And I should find "Forum message" in the app But I should not find "Site home" in the app - When I press the back button in the app + When I go back in the app Then I should find "Site home" in the app But I should not find "Forum topic" in the app And I should not find "Forum message" in the app @@ -75,6 +75,6 @@ Feature: It navigates properly using deep links. And I press "Log in" in the app Then I should find "Test forum" in the app - When I press the back button in the app + When I go back in the app Then I should find "Site home" in the app But I should not find "Test forum" in the app diff --git a/src/core/tests/behat/navigation_externallinks.feature b/src/core/tests/behat/navigation_externallinks.feature index edfb96896..d1de3c472 100644 --- a/src/core/tests/behat/navigation_externallinks.feature +++ b/src/core/tests/behat/navigation_externallinks.feature @@ -30,7 +30,7 @@ Feature: It opens external links properly. Then the app should have opened a browser tab with url "moodle.org" When I close the browser tab opened by the app - And I press the back button in the app + And I go back in the app And I press "Information" in the app And I press "Open in browser" in the app Then the app should have opened a browser tab diff --git a/src/core/tests/behat/navigation_splitview.feature b/src/core/tests/behat/navigation_splitview.feature index faa71cc08..a6472f9fe 100644 --- a/src/core/tests/behat/navigation_splitview.feature +++ b/src/core/tests/behat/navigation_splitview.feature @@ -45,7 +45,7 @@ Feature: It navigates properly in pages with a split-view component. And I should find "40" near "Range" in the app # Go back to grades page - When I press the back button in the app + When I go back in the app Then the header should be "Grades" in the app And I should find "Course 1" in the app And I should find "Course 2" in the app @@ -61,13 +61,13 @@ Feature: It navigates properly in pages with a split-view component. And I should find "80" near "Range" in the app # Go back to grades page - When I press the back button in the app + When I go back in the app Then the header should be "Grades" in the app And I should find "Course 1" in the app And I should find "Course 2" in the app # Go back to main page - When I press the back button in the app + When I go back in the app Then I should find "Acceptance test site" in the app And I should find "User account" in the app But I should not find "Back" in the app @@ -106,7 +106,7 @@ Feature: It navigates properly in pages with a split-view component. And I should find "80" near "Range" in the app # Go back to main page - When I press the back button in the app + When I go back in the app Then I should find "Acceptance test site" in the app And I should find "User account" in the app But I should not find "Back" in the app diff --git a/src/core/tests/behat/open_files.feature b/src/core/tests/behat/open_files.feature index bea27679f..9e7e097b9 100644 --- a/src/core/tests/behat/open_files.feature +++ b/src/core/tests/behat/open_files.feature @@ -29,7 +29,7 @@ Feature: It opens files properly. Then I should see "Test resource A txt.txt file" When I close the browser tab opened by the app - And I press the back button in the app + And I go back in the app And I press "Test RTF" in the app And I press "Open" in the app Then I should find "This file may not work as expected on this device" in the app @@ -48,7 +48,7 @@ Feature: It opens files properly. Then I should not find "This file may not work as expected on this device" in the app And the app should have opened url "^blob:" with contents "Test resource A rtf.rtf file" 3 times - When I press the back button in the app + When I go back in the app And I press "Test DOC" in the app And I press "Open" in the app Then I should find "This file may not work as expected on this device" in the app @@ -73,7 +73,7 @@ Feature: It opens files properly. Then the app should have opened a browser tab with url "dummy.pdf" When I close the browser tab opened by the app - And I press the back button in the app + And I go back in the app And I press "Page with embedded web" in the app And I press "Open in browser" in the app And I press "OK" in the app @@ -85,16 +85,15 @@ Feature: It opens files properly. Then I should find "There was a problem connecting to the site. Please check your connection and try again." in the app When I press "OK" in the app - And I press the back button in the app + And I go back in the app And I press "Page with embedded PDF" in the app And I press "Open PDF file" in the app Then the app should have opened a browser tab with url "^blob" When I close the browser tab opened by the app When I switch network connection to wifi - And I press the back button in the app - And I press the back button in the app - And I press "More" in the app + And I go back to the root page in the app + And I press the more menu button in the app And I press "PDF item" in the app And I press "Open PDF file" in the app Then the app should have opened a browser tab with url "dummy.pdf" diff --git a/src/testing/services/behat-runtime.ts b/src/testing/services/behat-runtime.ts index 6c0277878..f032481e8 100644 --- a/src/testing/services/behat-runtime.ts +++ b/src/testing/services/behat-runtime.ts @@ -184,6 +184,16 @@ export class TestingBehatRuntimeService { async pressStandard(button: string): Promise { this.log('Action - Click standard button: ' + button); + // @deprecated usage, use goBack instead. + if (button === 'back') { + const success = await this.goBack(); + if (success) { + return 'OK'; + } else { + return 'ERROR: Back button not found'; + } + } + // Find button let foundButton: HTMLElement | undefined; const options: TestingBehatFindOptions = { @@ -191,10 +201,6 @@ export class TestingBehatRuntimeService { }; switch (button) { - case 'back': - foundButton = TestingBehatDomUtils.findElementBasedOnText({ text: 'Back' }, options); - break; - case 'main menu': // Deprecated name. case 'more menu': foundButton = TestingBehatDomUtils.findElementBasedOnText({ text: 'More', @@ -224,6 +230,72 @@ export class TestingBehatRuntimeService { return 'OK'; } + /** + * Function to go back the maximum number of times possible. + * + * @returns OK if successful, or ERROR: followed by message. + */ + async goBackToRoot(): Promise { + this.log('Action - Go back to root'); + + let success = true; + + do { + success = await this.goBack(); + } while (success); + + return 'OK'; + } + + /** + * Function to go back many times in the app. + * + * @param times How many times to go back. + * @returns OK if successful, or ERROR: followed by message. + */ + async goBackTimes(times = 1): Promise { + this.log(`Action - Go back ${times} times`); + + for (let i = 0; i < times; i++) { + const success = await this.goBack(); + + if (!success) { + return 'ERROR: Back button not found'; + } + } + + return 'OK'; + } + + /** + * Function to go back in the app. + * + * @returns Whether the action is successful or not. + */ + protected async goBack(): Promise { + const options: TestingBehatFindOptions = { + onlyClickable: true, + containerName: '', + }; + + const foundButton = TestingBehatDomUtils.findElementBasedOnText({ + text: 'Back', + selector: 'ion-back-button', + }, options); + + if (!foundButton) { + return false; + } + + // Click button + await TestingBehatDomUtils.pressElement(foundButton); + + // Block Behat for at least 500ms, WS calls or DOM changes might not begin immediately. + TestingBehatBlocking.wait(500); + + return true; + } + /** * When there is a popup, clicks on the backdrop. *