forked from sillsdev/web-languageforge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rune2e.sh
executable file
·43 lines (38 loc) · 1.27 KB
/
rune2e.sh
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
#!/usr/bin/env bash
# Usage
# rune2e.sh lf : runs E2E tests for LF
# rune2e.sh sf : runs E2E tests for SF
# rune2e.sh jp : runs E2E tests for JP
# rune2e.sh lf --specs lexicon-new-project : runs lexicon-new-project spec for LF
#
# Note, make sure webdriver-manager is running
# gulp test-e2e-webdriver_standalone
if [ "$1" = "lf" ]
then
E2EHOSTNAME="languageforge.localhost"
elif [ "$1" = "sf" ]
then
E2EHOSTNAME="scriptureforge.localhost"
elif [ "$1" = "jp" ]
then
E2EHOSTNAME="jamaicanpsalms.scriptureforge.localhost"
else
E2EHOSTNAME="languageforge.localhost"
fi
attach_debugger () {
# Searches for the Node process running Protractor tests, then signals for it to attach the debugger
echo "Waiting for a Protractor process to appear so the debugger can be attached..."
PID=""
while [ "$PID" = "" ]; do
PID=$(pgrep -f protractor/built/cli.js)
sleep 0.25;
done
# See https://nodejs.org/en/docs/guides/debugging-getting-started/
kill -s SIGUSR1 "$PID"
echo "Protractor process signaled to have debugger listen."
}
attach_debugger &
gulp test-e2e-run --webserverHost $E2EHOSTNAME ${@:2}
STATUS=$?
gulp test-e2e-teardownForLocalDev
exit $STATUS