Skip to content

Commit 2a9b4f2

Browse files
authored
Merge pull request #11 from moodlehq/MDL-69421
MDL-69421: Fix tests running with moodle-ci-runner
2 parents cd02871 + 725bf48 commit 2a9b4f2

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

mod/choice/tests/behat/app_basic_usage.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Feature: Test basic usage of choice activity in app
130130
And I should not see "Option 3: 0"
131131

132132
When I run cron tasks in the app
133+
And I wait loading to finish in the app
133134
Then I should see "Option 1: 0"
134135
And I should see "Option 2: 1"
135136
And I should see "Option 3: 0"

mod/login/tests/behat/app_basic_usage.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Feature: Test basic usage of login in app
2121
Scenario: Add a new site in the app & Site name in displayed when adding a new site
2222
When I enter the app
2323
And I press the back button in the app
24-
And I set the field "https://campus.example.edu" to "webserver" in the app
24+
And I set the field "https://campus.example.edu" to "$WEBSERVER" in the app
2525
And I press "Connect to your site" in the app
2626
Then I should see "Acceptance test site"
2727

tests/behat/behat_local_moodlemobileapp.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,21 @@ function() use ($session) {
9797
);
9898
}
9999

100+
/**
101+
* Replaces $WEBSERVER for webserver env variable value, defaults to "webserver" if it is not set.
102+
*
103+
* @Transform /^(.*\$WEBSERVER.*)$/
104+
* @param string $text Text.
105+
* @return string
106+
*/
107+
public function arg_replace_webserver_env($text) {
108+
$webserver = getenv('WEBSERVER');
109+
110+
if ($webserver === false) {
111+
$webserver = 'webserver';
112+
}
113+
114+
return str_replace('$WEBSERVER', $webserver, $text);
115+
}
116+
100117
}

0 commit comments

Comments
 (0)