-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7acedf
commit bfaa63f
Showing
3 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
PATH="vendor/bin:$PATH" | ||
testport=${E2E_PORT:-"5000"} | ||
|
||
|
||
if [ -d 'bedrock-on-heroku' ]; then | ||
config='config/app_nginx.conf.php' | ||
path='bedrock-on-heroku/web' | ||
elif [ -d 'web' ]; then | ||
config='config/heroku/nginx.conf' | ||
path='web' | ||
elif [ -d 'public' ]; then | ||
config='nginx.conf' | ||
path='public' | ||
else | ||
config='config/heroku/nginx.conf' | ||
path='web' | ||
fi | ||
|
||
testproc=${E2E_PROC:-"heroku-php-nginx -C $config $path"} | ||
|
||
|
||
if [ -f 'tests/pa11y/pa11y.conf.json' ]; then | ||
testSpec='tests/pa11y/pa11y.conf.json' | ||
else | ||
testSpec='pa11y/pa11y.conf.json' | ||
fi | ||
|
||
testspec=${E2E_SPEC:-"$testSpec"} | ||
|
||
hash npx 2>/dev/null || { echo >&2 "Unable to find npx in PATH."; exit 1; } | ||
hash chromedriver 2>/dev/null || { echo >&2 "Unable to find chromedriver in PATH."; exit 1; } | ||
[[ -f $testspec ]] || { echo >&2 "No pa11y tests defined: $testspec not found."; exit 1; } | ||
|
||
PORT=$testport $testproc >/tmp/$$-http-log.txt 2>&1 & | ||
proc_pid=$! | ||
|
||
|
||
chromedriver --port=9515 >/dev/null 2>&1 & | ||
chromedriver_pid=$! | ||
|
||
npx wait-on -l "tcp:$testport" "tcp:9515" | ||
npx pa11y-ci --config "$testspec" | ||
pa11y_exit=$? | ||
|
||
echo "--- http server log ---" | ||
cat /tmp/$$-http-log.txt | ||
echo "--- http server log ---" | ||
|
||
kill $chromedriver_pid $proc_pid | ||
exit $pa11y_exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
], | ||
"dependencies": { | ||
"protractor": "~5.3.0", | ||
"wait-on": "^2.1.0" | ||
"wait-on": "^2.1.0", | ||
"pa11y-ci": "~1.0" | ||
} | ||
} |