diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-06-28 17:21:12 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-06-28 17:32:38 +0200 |
commit | ea6b5063b50753d5573223ec2a804750cc991f51 (patch) | |
tree | 284779a81f8ddc5bbe67066a677a4501bdcd4e43 /tests/acceptance | |
parent | a077c129c8006e9cd9b864c343f49181fe562592 (diff) | |
download | nextcloud-server-ea6b5063b50753d5573223ec2a804750cc991f51.tar.gz nextcloud-server-ea6b5063b50753d5573223ec2a804750cc991f51.zip |
Fix variable not replaced in "behat.yml" when default value was used
As "selenium.server" is a simulated variable it is not recognized by
Mink, so it must be always replaced by its value in "behat.yml" before
the file is parsed by Behat.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/acceptance')
-rwxr-xr-x | tests/acceptance/run-local.sh | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/tests/acceptance/run-local.sh b/tests/acceptance/run-local.sh index 529026483cf..e924bd94f3f 100755 --- a/tests/acceptance/run-local.sh +++ b/tests/acceptance/run-local.sh @@ -171,21 +171,19 @@ REPLACEMENT="profile: $ACCEPTANCE_TESTS_CONFIG_DIR" FILE_CONTENTS=$(<$ACCEPTANCE_TESTS_CONFIG_DIR/behat.yml) echo "${FILE_CONTENTS//$ORIGINAL/$REPLACEMENT}" > $ACCEPTANCE_TESTS_CONFIG_DIR/behat.yml -if [ "$SELENIUM_SERVER" != "$DEFAULT_SELENIUM_SERVER" ]; then - # Set the Selenium server to be used by Mink. Although Mink sessions can be - # extended through BEHAT_PARAMS this would require adding here too each new - # session added to "behat.yml", including those added in the acceptance - # tests of apps. Instead, the default "behat.yml" configuration file is - # adjusted to replace the simulated "selenium.server" variable by its value - # before the configuration file is parsed by Behat. - ORIGINAL="wd_host: %selenium.server%" - REPLACEMENT="wd_host: http://$SELENIUM_SERVER/wd/hub" - # As the substitution does not involve regular expressions or multilines it - # can be done just with Bash. Moreover, this does not require escaping the - # regular expression characters that may appear in the URL, like "/". - FILE_CONTENTS=$(<$ACCEPTANCE_TESTS_CONFIG_DIR/behat.yml) - echo "${FILE_CONTENTS//$ORIGINAL/$REPLACEMENT}" > $ACCEPTANCE_TESTS_CONFIG_DIR/behat.yml -fi +# Set the Selenium server to be used by Mink. Although Mink sessions can be +# extended through BEHAT_PARAMS this would require adding here too each new +# session added to "behat.yml", including those added in the acceptance +# tests of apps. Instead, the default "behat.yml" configuration file is +# adjusted to replace the simulated "selenium.server" variable by its value +# before the configuration file is parsed by Behat. +ORIGINAL="wd_host: %selenium.server%" +REPLACEMENT="wd_host: http://$SELENIUM_SERVER/wd/hub" +# As the substitution does not involve regular expressions or multilines it +# can be done just with Bash. Moreover, this does not require escaping the +# regular expression characters that may appear in the URL, like "/". +FILE_CONTENTS=$(<$ACCEPTANCE_TESTS_CONFIG_DIR/behat.yml) +echo "${FILE_CONTENTS//$ORIGINAL/$REPLACEMENT}" > $ACCEPTANCE_TESTS_CONFIG_DIR/behat.yml composer install |