File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- if ! which nightwatch ; then
4- echo " Nightwatch not installed globally . This is necessary for running tests"
5- echo " npm install nightwatch -g "
3+ if [ ! -f ./node_modules/.bin/ nightwatch ] ; then
4+ echo " Nightwatch not installed. This is necessary for running tests"
5+ echo " Run ` npm install` to install it locally "
66 exit 1
77fi
88
99NIGHTWATCH_ENV=${NIGHTWATCH_ENV:- default}
1010
1111# Run background jobs
12+ echo " Starting mockserver..."
1213java -Droot.logLevel=OFF -Dmockserver.logLevel=OFF -jar tests/mockserver-netty-3.9.17-jar-with-dependencies.jar -serverPort 9999 > /dev/null 2>&1 &
14+ MOCKSERVER_PID=$!
1315sleep 3
1416
17+ trap ctrl_c INT
18+ function ctrl_c() {
19+ echo " Killing mockserver..."
20+ kill $MOCKSERVER_PID > /dev/null 2>&1
21+ wait
22+
23+ exit 1
24+ }
25+
1526cd tests
1627
1728# Set the urls of the mockserver
29+ echo " Creating mocks..."
1830node setMocks.js
1931
2032# Run tests
21- nightwatch --test --env " $NIGHTWATCH_ENV "
33+ ../node_modules/.bin/ nightwatch --test --env " $NIGHTWATCH_ENV "
2234status_nightwatch=$?
2335
2436cd ..
2537
26- # Kill background jobs
27- killall java
38+ echo " Killing mockserver... "
39+ kill $MOCKSERVER_PID > /dev/null 2>&1
2840wait
2941
3042if [[ ${status_nightwatch} != 0 ]] ; then
You can’t perform that action at this time.
0 commit comments