forked from fabric8-ui/fabric8-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_EE_tests.sh
executable file
·40 lines (32 loc) · 1.03 KB
/
run_EE_tests.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
#!/usr/bin/env bash
LOGFILE=$(pwd)/functional_tests.log
echo Using logfile $LOGFILE
# For the functional tests, we are mocking the core
export NODE_ENV=inmemory
# Start selenium server just for this test run
echo -n Starting Webdriver and Selenium...
(webdriver-manager start --versions.chrome 2.24 >>$LOGFILE 2>&1 &)
# Wait for port 4444 to be listening connections
while ! (ncat -w 1 127.0.0.1 4444 </dev/null >/dev/null 2>&1); do sleep 1; done
echo done.
# Finally run protractor
echo Running tests...
set +x
cat ~/payload/jenkins-env | grep EE_TEST > ~/.ee_test_params
. ~/.ee_test_params
node_modules/protractor/bin/protractor protractorEE.config.js --params.login.user=$EE_TEST_USERNAME --params.login.password=$EE_TEST_PASSWORD --params.target.url=$1
TEST_RESULT=$?
set -x
# cat log file to stdout
cat $LOGFILE
# Cleanup webdriver-manager and web app processes
fuser -k -n tcp 4444
fuser -k -n tcp 8088
# Return test result
if [ $TEST_RESULT -eq 0 ]; then
echo 'Functional tests OK'
exit 0
else
echo 'Functional tests FAIL'
exit 1
fi