Merge pull request #9665 from nextcloud/add-workaround-for-parameter-not-available-in-mink-extension
Add workaround for parameter not available in Mink Extension
This commit is contained in:
commit
8376ca3eb7
|
@ -36,4 +36,4 @@ default:
|
||||||
selenium2:
|
selenium2:
|
||||||
capabilities:
|
capabilities:
|
||||||
firefox:
|
firefox:
|
||||||
profile: config/firefox-profiles/css-grid-enabled.zip
|
profile: %paths.base%/firefox-profiles/css-grid-enabled.zip
|
||||||
|
|
|
@ -63,6 +63,8 @@ if [ "$1" = "--acceptance-tests-dir" ]; then
|
||||||
shift 2
|
shift 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ACCEPTANCE_TESTS_CONFIG_DIR="../../$ACCEPTANCE_TESTS_DIR/config"
|
||||||
|
|
||||||
# "--timeout-multiplier N" option can be provided to set the timeout multiplier
|
# "--timeout-multiplier N" option can be provided to set the timeout multiplier
|
||||||
# to be used in ActorContext.
|
# to be used in ActorContext.
|
||||||
TIMEOUT_MULTIPLIER=""
|
TIMEOUT_MULTIPLIER=""
|
||||||
|
@ -133,7 +135,7 @@ if [ "$TIMEOUT_MULTIPLIER" != "" ]; then
|
||||||
REPLACEMENT="\
|
REPLACEMENT="\
|
||||||
- ActorContext:\n\
|
- ActorContext:\n\
|
||||||
actorTimeoutMultiplier: $TIMEOUT_MULTIPLIER"
|
actorTimeoutMultiplier: $TIMEOUT_MULTIPLIER"
|
||||||
sed --in-place "s/$ORIGINAL/$REPLACEMENT/" ../../$ACCEPTANCE_TESTS_DIR/config/behat.yml
|
sed --in-place "s/$ORIGINAL/$REPLACEMENT/" $ACCEPTANCE_TESTS_CONFIG_DIR/behat.yml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$NEXTCLOUD_SERVER_DOMAIN" != "$DEFAULT_NEXTCLOUD_SERVER_DOMAIN" ]; then
|
if [ "$NEXTCLOUD_SERVER_DOMAIN" != "$DEFAULT_NEXTCLOUD_SERVER_DOMAIN" ]; then
|
||||||
|
@ -154,9 +156,21 @@ if [ "$NEXTCLOUD_SERVER_DOMAIN" != "$DEFAULT_NEXTCLOUD_SERVER_DOMAIN" ]; then
|
||||||
- NextcloudTestServerContext:\n\
|
- NextcloudTestServerContext:\n\
|
||||||
nextcloudTestServerHelperParameters:\n\
|
nextcloudTestServerHelperParameters:\n\
|
||||||
- $NEXTCLOUD_SERVER_DOMAIN"
|
- $NEXTCLOUD_SERVER_DOMAIN"
|
||||||
sed --in-place "s/$ORIGINAL/$REPLACEMENT/" ../../$ACCEPTANCE_TESTS_DIR/config/behat.yml
|
sed --in-place "s/$ORIGINAL/$REPLACEMENT/" $ACCEPTANCE_TESTS_CONFIG_DIR/behat.yml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Due to a bug in the Mink Extension for Behat it is not possible to use the
|
||||||
|
# "paths.base" parameter in the path to the custom Firefox profile. Thus, the
|
||||||
|
# default "behat.yml" configuration file has to be adjusted to replace the
|
||||||
|
# parameter by its value before the configuration file is parsed by Behat.
|
||||||
|
ORIGINAL="profile: %paths.base%"
|
||||||
|
REPLACEMENT="profile: $ACCEPTANCE_TESTS_CONFIG_DIR"
|
||||||
|
# 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 path, like "/".
|
||||||
|
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
|
if [ "$SELENIUM_SERVER" != "$DEFAULT_SELENIUM_SERVER" ]; then
|
||||||
# Set the Selenium server to be used by Mink; this extends the default
|
# Set the Selenium server to be used by Mink; this extends the default
|
||||||
# configuration from "config/behat.yml".
|
# configuration from "config/behat.yml".
|
||||||
|
@ -215,4 +229,4 @@ cd tests/acceptance
|
||||||
echo "Waiting for Selenium"
|
echo "Waiting for Selenium"
|
||||||
timeout 60s bash -c "while ! curl $SELENIUM_SERVER >/dev/null 2>&1; do sleep 1; done"
|
timeout 60s bash -c "while ! curl $SELENIUM_SERVER >/dev/null 2>&1; do sleep 1; done"
|
||||||
|
|
||||||
vendor/bin/behat --config=../../$ACCEPTANCE_TESTS_DIR/config/behat.yml $SCENARIO_TO_RUN
|
vendor/bin/behat --config=$ACCEPTANCE_TESTS_CONFIG_DIR/behat.yml $SCENARIO_TO_RUN
|
||||||
|
|
Loading…
Reference in New Issue