2018-04-07 14:35:26 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
2018-04-21 01:10:56 +00:00
|
|
|
# Check the command before running in background so
|
|
|
|
|
# that it can actually fail and have a descriptive error
|
|
|
|
|
hash chromedriver
|
2018-06-07 16:27:06 +00:00
|
|
|
chromedriver --url-base=wd/hub --port=4444 &
|
2018-06-07 16:20:59 +00:00
|
|
|
CHROME_DRIVER_PID=$!
|
|
|
|
|
echo chromedriver running with PID $CHROME_DRIVER_PID
|
2018-04-07 14:35:26 +00:00
|
|
|
# Make sure it is killed to prevent file descriptors leak
|
|
|
|
|
function kill_chromedriver() {
|
2018-06-07 16:20:59 +00:00
|
|
|
# Use kill instead of killall to increase chances of this working on Windows
|
|
|
|
|
kill $CHROME_DRIVER_PID > /dev/null
|
2018-04-07 14:35:26 +00:00
|
|
|
}
|
|
|
|
|
trap kill_chromedriver EXIT
|
2018-04-23 14:56:54 +00:00
|
|
|
npm run selenium-test
|