Run all browsers before failing

This commit is contained in:
Chi Vinh Le
2017-10-17 22:48:00 +07:00
parent afb591d990
commit ce131dd067
+26 -14
View File
@@ -1,23 +1,35 @@
#!/bin/bash
set -e
if [[ "${CIRCLE_BRANCH}" == "master" ]]; then
exitCode=0
browserstack() {
REPORTS_FOLDER="$CIRCLE_TEST_REPORTS/$1" yarn e2e-browserstack -- --env "$1"
# Determine exit code.
result=$?
if [ "$result" -gt "0" ]
then
exitCode=$result
fi
# Sleep abit to let browserstackLocal to close properly.
sleep 2
}
# Test using browserstack.
REPORTS_FOLDER="$CIRCLE_TEST_REPORTS/chrome" yarn e2e-browserstack -- --env chrome
sleep 2
browserstack chrome
browserstack firefox
browserstack safari
browserstack ie
browserstack edge
REPORTS_FOLDER="$CIRCLE_TEST_REPORTS/firefox" yarn e2e-browserstack -- --env firefox
sleep 2
REPORTS_FOLDER="$CIRCLE_TEST_REPORTS/safari" yarn e2e-browserstack -- --env safari
sleep 2
REPORTS_FOLDER="$CIRCLE_TEST_REPORTS/ie" yarn e2e-browserstack -- --env ie
sleep 2
REPORTS_FOLDER="$CIRCLE_TEST_REPORTS/edge" yarn e2e-browserstack -- --env edge
exit $exitCode
else
# When browserstack is not available test locally using chrome headless.
REPORTS_FOLDER="$CIRCLE_TEST_REPORTS/chrome" yarn e2e -- --env chrome-headless
# Will exit with status of last command.
exit $?
fi