MDL-69421: Fix tests running with moodle-ci-runner

main
Noel De Martin 2020-08-24 12:48:31 +02:00
parent 587df333eb
commit 0deeb5584c
3 changed files with 19 additions and 1 deletions

View File

@ -130,6 +130,7 @@ Feature: Test basic usage of choice activity in app
And I should not see "Option 3: 0" And I should not see "Option 3: 0"
When I run cron tasks in the app When I run cron tasks in the app
And I wait loading to finish in the app
Then I should see "Option 1: 0" Then I should see "Option 1: 0"
And I should see "Option 2: 1" And I should see "Option 2: 1"
And I should see "Option 3: 0" And I should see "Option 3: 0"

View File

@ -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 Scenario: Add a new site in the app & Site name in displayed when adding a new site
When I enter the app When I enter the app
And I press the back button in 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 And I press "Connect to your site" in the app
Then I should see "Acceptance test site" Then I should see "Acceptance test site"

View File

@ -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);
}
} }