2018-02-27 18:24:07 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set +x -eu -o pipefail
|
|
|
|
|
|
|
|
(
|
|
|
|
readonly thisDir="$(cd $(dirname ${BASH_SOURCE[0]}); pwd)"
|
|
|
|
readonly aioDir="$(realpath $thisDir/..)"
|
|
|
|
|
2018-04-15 17:02:28 -04:00
|
|
|
readonly protractorConf="$aioDir/tests/deployment/e2e/protractor.conf.js"
|
2019-04-25 06:54:10 -04:00
|
|
|
readonly targetUrl="$1"
|
|
|
|
readonly minPwaScore="$2"
|
2018-02-27 18:24:07 -05:00
|
|
|
|
|
|
|
cd "$aioDir"
|
|
|
|
|
|
|
|
# Install dependencies.
|
|
|
|
echo -e "\nInstalling dependencies in '$aioDir'...\n-----"
|
2020-01-29 06:59:52 -05:00
|
|
|
yarn install --frozen-lockfile --non-interactive
|
2018-02-27 18:24:07 -05:00
|
|
|
yarn update-webdriver
|
|
|
|
|
2019-04-25 06:54:10 -04:00
|
|
|
# Run checks for target URL.
|
|
|
|
echo -e "\nChecking '$targetUrl'...\n-----"
|
2018-02-27 18:24:07 -05:00
|
|
|
|
2019-04-25 06:54:10 -04:00
|
|
|
# Run basic e2e and deployment config tests.
|
|
|
|
yarn protractor "$protractorConf" --baseUrl "$targetUrl"
|
2018-02-27 18:24:07 -05:00
|
|
|
|
2019-04-25 06:54:10 -04:00
|
|
|
# Run PWA-score tests.
|
|
|
|
yarn test-pwa-score "$targetUrl" "$minPwaScore"
|
2018-02-27 18:24:07 -05:00
|
|
|
|
2019-07-03 19:34:32 -04:00
|
|
|
# Run a11y tests.
|
|
|
|
yarn test-a11y-score "$targetUrl"
|
|
|
|
|
2018-02-27 18:24:07 -05:00
|
|
|
echo -e "\nAll checks passed!"
|
|
|
|
)
|