diff --git a/lib/tests/behat/app_behat_runtime.js b/lib/tests/behat/app_behat_runtime.js index 01121575150..56fdbc3b3e7 100644 --- a/lib/tests/behat/app_behat_runtime.js +++ b/lib/tests/behat/app_behat_runtime.js @@ -410,7 +410,8 @@ case 'page menu' : // This lang string was changed in app version 3.6. selector = 'core-context-menu > button[aria-label=Info], ' + - 'core-context-menu > button[aria-label=Information]'; + 'core-context-menu > button[aria-label=Information], ' + + 'core-context-menu > button[aria-label="Display options"]'; break; default: return 'ERROR: Unsupported standard button type'; diff --git a/lib/tests/behat/behat_app.php b/lib/tests/behat/behat_app.php index f82ce5d702c..af82844ec7d 100644 --- a/lib/tests/behat/behat_app.php +++ b/lib/tests/behat/behat_app.php @@ -303,12 +303,22 @@ class behat_app extends behat_base { // Wait until the site login field appears OR the main page. $situation = $this->spin( function($context, $args) { - $input = $context->getSession()->getPage()->find('xpath', '//input[@name="url"]'); - if ($input) { + $page = $context->getSession()->getPage(); + + $element = $page->find('xpath', '//page-core-login-site//input[@name="url"]'); + if ($element) { + // Wait for the onboarding modal to open, if any. + $this->wait_for_pending_js(); + $element = $page->find('xpath', '//page-core-login-site-onboarding'); + if ($element) { + $this->i_press_in_the_app('Skip'); + } + return 'login'; } - $mainmenu = $context->getSession()->getPage()->find('xpath', '//page-core-mainmenu'); - if ($mainmenu) { + + $element = $page->find('xpath', '//page-core-mainmenu'); + if ($element) { return 'mainpage'; } throw new DriverException('Moodle app login URL prompt not found'); @@ -317,7 +327,7 @@ class behat_app extends behat_base { // If it's the login page, we automatically fill in the URL and leave it on the user/pass // page. If it's the main page, we just leave it there. if ($situation === 'login') { - $this->i_set_the_field_in_the_app('Site address', $CFG->wwwroot); + $this->i_set_the_field_in_the_app('campus.example.edu', $CFG->wwwroot); $this->i_press_in_the_app('Connect!'); }