diff --git a/mod/choice/tests/behat/app_basic_usage.feature b/mod/choice/tests/behat/app_basic_usage.feature index 74cfd7429..86055ca25 100755 --- a/mod/choice/tests/behat/app_basic_usage.feature +++ b/mod/choice/tests/behat/app_basic_usage.feature @@ -130,6 +130,7 @@ Feature: Test basic usage of choice activity in app And I should not see "Option 3: 0" When I run cron tasks in the app + And I wait loading to finish in the app Then I should see "Option 1: 0" And I should see "Option 2: 1" And I should see "Option 3: 0" diff --git a/mod/login/tests/behat/app_basic_usage.feature b/mod/login/tests/behat/app_basic_usage.feature index 4321f9ca9..0071ad1a7 100755 --- a/mod/login/tests/behat/app_basic_usage.feature +++ b/mod/login/tests/behat/app_basic_usage.feature @@ -21,7 +21,7 @@ Feature: Test basic usage of login in app Scenario: Add a new site in the app & Site name in displayed when adding a new site When I enter the app And I press the back button in the app - And I set the field "https://campus.example.edu" to "webserver" in the app + And I set the field "https://campus.example.edu" to "$WEBSERVER" in the app And I press "Connect to your site" in the app Then I should see "Acceptance test site" diff --git a/tests/behat/behat_local_moodlemobileapp.php b/tests/behat/behat_local_moodlemobileapp.php index 37ff72ea9..603f055bf 100644 --- a/tests/behat/behat_local_moodlemobileapp.php +++ b/tests/behat/behat_local_moodlemobileapp.php @@ -97,4 +97,21 @@ class behat_local_moodlemobileapp extends behat_base { ); } + /** + * Replaces $WEBSERVER for webserver env variable value, defaults to "webserver" if it is not set. + * + * @Transform /^(.*\$WEBSERVER.*)$/ + * @param string $text Text. + * @return string + */ + public function arg_replace_webserver_env($text) { + $webserver = getenv('WEBSERVER'); + + if ($webserver === false) { + $webserver = 'webserver'; + } + + return str_replace('$WEBSERVER', $webserver, $text); + } + }