forked from open-xml-templating/docxtemplater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webdriver.bash
executable file
·51 lines (46 loc) · 1.27 KB
/
webdriver.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -euo pipefail
pid=""
cleanup() {
if [ "$pid" != "" ]
then
while true
do
kill "$pid" 1>/dev/null 2>&1 || break
sleep 1
done
fi
}
trap "cleanup" EXIT INT
BROWSER="${BROWSER:-CHROME|FIREFOX|}"
PATH="$PATH:./node_modules/.bin/"
if grep '|' <<<"$BROWSER" >/dev/null
then
while read -d '|' browser
do
echo "$browser"
BROWSER="$browser" ./webdriver.bash
done <<<"$BROWSER"
exit 0
fi
if [ "$BROWSER" != "SAUCELABS" ]
then
if netstat -tnlp 2>/dev/null | grep --color -E 4444 >/dev/null
then
echo "Using existing selenium"
else
selenium-standalone install --silent
selenium-standalone start -- -log /tmp/protractor.log &
pid="$!"
fi
node webdriver.js
exit "$?"
fi
result=0
browserName="MicrosoftEdge" platform="Windows 10" version="16.16299" node webdriver.js || result=1
browserName="safari" platform="macOs 10.12" version="11.0" filter="Speed test" node webdriver.js || result=1
browserName="chrome" platform="Windows 10" version="58" node webdriver.js || result=1
browserName="firefox" platform="Windows 10" version="55" node webdriver.js || result=1
browserName="internet explorer" platform="Windows 10" version="11" node webdriver.js || result=1
browserName="iphone" platform="Mac 10.11" version="10.2" node webdriver.js || result=1
exit "$result"