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-----"
|
2018-10-22 08:34:59 -04: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
|
|
|
|
|
|
|
echo -e "\nAll checks passed!"
|
|
|
|
)
|