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"
|
2018-09-27 09:35:05 -04:00
|
|
|
readonly minPwaScore="$1"
|
2018-02-27 18:24:07 -05:00
|
|
|
readonly urls=(
|
|
|
|
"https://angular.io/"
|
2018-04-15 16:55:21 -04:00
|
|
|
"https://next.angular.io/"
|
2018-02-27 18:24:07 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
cd "$aioDir"
|
|
|
|
|
|
|
|
# Install dependencies.
|
|
|
|
echo -e "\nInstalling dependencies in '$aioDir'...\n-----"
|
|
|
|
yarn install --frozen-lockfile
|
|
|
|
yarn update-webdriver
|
|
|
|
|
|
|
|
# Run checks for all URLs.
|
|
|
|
for url in "${urls[@]}"; do
|
|
|
|
echo -e "\nChecking '$url'...\n-----"
|
|
|
|
|
2018-04-15 17:02:28 -04:00
|
|
|
# Run basic e2e and deployment config tests.
|
|
|
|
yarn protractor "$protractorConf" --baseUrl "$url"
|
2018-02-27 18:24:07 -05:00
|
|
|
|
|
|
|
# Run PWA-score tests.
|
|
|
|
yarn test-pwa-score "$url" "$minPwaScore"
|
|
|
|
done
|
|
|
|
|
|
|
|
echo -e "\nAll checks passed!"
|
|
|
|
)
|