Files
web3.js/scripts/e2e.firefox.sh
cgewecke a7235c84c6 Add karma & chrome/firefox headless browser fixtures (#3146)
* Add karma & chrome/firefox headless browser fixtures

* Add test helper for conditional web3 require

* Add websocket port test helper

* Move build/lint to their own CI job

* Fix package-lock from rebase

* Fix ci.sh

* Skip all websockets tests for geth.instamine
2019-10-22 07:19:56 +02:00

34 lines
813 B
Bash
Executable File

#!/usr/bin/env bash
# -------------------------------------------------------------------------------------
# Runs mocha tests tagged 'e2e' vs firefox headless + insta-mining ganache client
# -------------------------------------------------------------------------------------
# Exit immediately on error
set -o errexit
# Run cleanup on exit
trap cleanup EXIT
cleanup() {
if [ -n "$client" ]; then
kill -9 $client
fi
}
echo " "
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "E2E: firefox headless browser "
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo " "
# Launch ganache, track its PID and wait until port is open
npx ganache-cli --noVMErrorsOnRPCResponse > /dev/null &
client=$!
npx wait-port 8545
# Test
karma start \
--single-run \
--browsers FirefoxHeadless