From 40252a6ed6b52cb0de580fd9516099b7afdb861f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 24 Nov 2021 10:47:10 +0100 Subject: [PATCH] MOBILE-3810 behat: Change accounts and main menu to user and more menu --- mod/login/tests/behat/app_basic_usage.feature | 6 +++--- tests/behat/app_behat_runtime.js | 5 +++-- tests/behat/behat_app.php | 2 +- tests/behat/navigation_deeplinks.feature | 2 +- tests/behat/navigation_splitview.feature | 10 +++++----- tests/behat/plugins.feature | 4 ++-- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/mod/login/tests/behat/app_basic_usage.feature b/mod/login/tests/behat/app_basic_usage.feature index c1b1f5747..e985ce73f 100755 --- a/mod/login/tests/behat/app_basic_usage.feature +++ b/mod/login/tests/behat/app_basic_usage.feature @@ -33,7 +33,7 @@ Feature: Test basic usage of login in app Scenario: Add a non existing account When I enter the app And I log in as "student1" - And I press the accounts menu button in the app + And I press the user menu button in the app And I press "Log out" in the app And I wait the app to restart And I press "Add a new account" in the app @@ -45,7 +45,7 @@ Feature: Test basic usage of login in app Scenario: Add a non existing account from accounts switcher When I enter the app And I log in as "student1" - And I press the accounts menu button in the app + And I press the user menu button in the app And I press "Switch account" in the app And I press "Add a new account" in the app And I wait the app to restart @@ -57,7 +57,7 @@ Feature: Test basic usage of login in app Scenario: Delete an account When I enter the app And I log in as "student1" - And I press the accounts menu button in the app + And I press the user menu button in the app And I press "Log out" in the app And I wait the app to restart Then I should find "Acceptance test site" in the app diff --git a/tests/behat/app_behat_runtime.js b/tests/behat/app_behat_runtime.js index 5c1ff5e84..265704e6a 100644 --- a/tests/behat/app_behat_runtime.js +++ b/tests/behat/app_behat_runtime.js @@ -445,13 +445,14 @@ case 'back': foundButton = findElementsBasedOnText({ text: 'Back' })[0]; break; - case 'main menu': + case 'main menu': // Deprecated name. + case 'more menu': foundButton = findElementsBasedOnText({ text: 'More', near: { text: 'Notifications' }, })[0]; break; - case 'accounts menu' : + case 'user menu' : foundButton = findElementsBasedOnText({ text: 'Account' })[0]; break; case 'page menu': diff --git a/tests/behat/behat_app.php b/tests/behat/behat_app.php index b4afc627c..c3c4a0ada 100644 --- a/tests/behat/behat_app.php +++ b/tests/behat/behat_app.php @@ -536,7 +536,7 @@ class behat_app extends behat_base { /** * Presses standard buttons in the app. * - * @Given /^I press the (back|main menu|page menu|accounts menu) button in the app$/ + * @Given /^I press the (back|more menu|page menu|user menu|main menu) button in the app$/ * @param string $button Button type * @throws DriverException If the button push doesn't work */ diff --git a/tests/behat/navigation_deeplinks.feature b/tests/behat/navigation_deeplinks.feature index 68d1ef148..ef6ac776f 100644 --- a/tests/behat/navigation_deeplinks.feature +++ b/tests/behat/navigation_deeplinks.feature @@ -25,7 +25,7 @@ Feature: It navigates properly using deep links. Scenario: Receive a push notification When I enter the app And I log in as "student2" - And I press the accounts menu button in the app + And I press the user menu button in the app And I press "Log out" in the app And I wait the app to restart And I press "Add a new account" in the app diff --git a/tests/behat/navigation_splitview.feature b/tests/behat/navigation_splitview.feature index 4648b023f..7efe86451 100644 --- a/tests/behat/navigation_splitview.feature +++ b/tests/behat/navigation_splitview.feature @@ -24,10 +24,10 @@ Feature: It navigates properly in pages with a split-view component. Scenario: Navigate in grades tab on mobile - # Open accounts menu + # Open user menu Given I enter the app And I log in as "student1" - And I press the accounts menu button in the app + And I press the user menu button in the app # Open grades page When I press "Grades" in the app @@ -87,11 +87,11 @@ Feature: It navigates properly in pages with a split-view component. Scenario: Navigate in grades tab on tablet - # Open accounts menu + # Open user menu Given I enter the app And I change viewport size to "1200x640" And I log in as "student1" - And I press the accounts menu button in the app + And I press the user menu button in the app # Open grades page When I press "Grades" in the app @@ -137,4 +137,4 @@ Feature: It navigates properly in pages with a split-view component. When I press the back button in the app Then I should find "Acceptance test site" in the app And I should find "Account" in the app - But I should not find "Back" in the app \ No newline at end of file + But I should not find "Back" in the app diff --git a/tests/behat/plugins.feature b/tests/behat/plugins.feature index 501e5a707..35d39f1ca 100644 --- a/tests/behat/plugins.feature +++ b/tests/behat/plugins.feature @@ -6,10 +6,10 @@ Feature: Plugins work properly. | username | | studentusername | - Scenario: See main menu button + Scenario: See more menu button When I enter the app And I log in as "studentusername" - And I press the main menu button in the app + And I press the more menu button in the app Then I should find "Moodle Mobile language strings" in the app When I press "Moodle Mobile language strings" in the app