From 5aa0cad10579dde22b97dfda738f25ea68ff74b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 16 May 2022 13:17:27 +0200 Subject: [PATCH] MOBILE-4061 behat: Separate enter site again --- .../tests/behat/behat_app.php | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/local-moodleappbehat/tests/behat/behat_app.php b/local-moodleappbehat/tests/behat/behat_app.php index 524ed7e3b..45dbaec51 100644 --- a/local-moodleappbehat/tests/behat/behat_app.php +++ b/local-moodleappbehat/tests/behat/behat_app.php @@ -59,16 +59,7 @@ class behat_app extends behat_app_helper { return; } - if (!$this->is_in_login_page()) { - // Already in the site. - return; - } - - global $CFG; - - $this->i_set_the_field_in_the_app('Your site', $CFG->behat_wwwroot); - $this->i_press_in_the_app('"Connect to your site"'); - $this->wait_for_pending_js(); + $this->enter_site(); } /** @@ -278,6 +269,22 @@ class behat_app extends behat_app_helper { $this->wait_for_pending_js(); } + /** + * Enter site. + */ + protected function enter_site() { + if (!$this->is_in_login_page()) { + // Already in the site. + return; + } + + global $CFG; + + $this->i_set_the_field_in_the_app('Your site', $CFG->wwwroot); + $this->i_press_in_the_app('"Connect to your site"'); + $this->wait_for_pending_js(); + } + /** * Shortcut to let the user enter a course in the app. *