-
Notifications
You must be signed in to change notification settings - Fork 0
/
e2e-test.sh
executable file
·52 lines (41 loc) · 1.08 KB
/
e2e-test.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
44
45
46
47
48
49
50
51
52
#!/bin/sh
DB_USER=SA
DB_URL=jdbc:hsqldb:file:
DB_SCHEMA=lunchydb
DB_DRIVER=org.hsqldb.jdbc.JDBCDriver
DB_PARAM="-Dlunchy.db.user=$DB_USER -Dlunchy.db.url=$DB_URL -Dlunchy.db.schema=$DB_SCHEMA -Dlunchy.db.driver=$DB_DRIVER"
rm -rf e2e-test-logs
mkdir e2e-test-logs
# start webdriver (with chrome-driver)
{
webdriver-manager start &
} &>e2e-test-logs/webdriver.log
# clear database files
rm -rf lunchydb.*
# create new database (file based)
{
mvn $DB_PARAM -DcreateTables=true process-resources
} &>e2e-test-logs/createdb.log
# compile and start jetty
{
mvn $DB_PARAM "-Dlunchy.picturedir=$TMPDIR" -Dhsqldb=true jetty:run &
} &>e2e-test-logs/jetty.log
# wait for jetty to be started
WEBDRIVER_PID=$(lsof -t -i @0.0.0.0:4444 -sTCP:listen)
echo "WEBDRIVER_PID:"$WEBDRIVER_PID
while [ -z "$JETTY_PID" ]
do
sleep 3
JETTY_PID=$(lsof -t -i @0.0.0.0:8080 -sTCP:listen)
done
echo "JETTY_PID:"$JETTY_PID
sleep 1
# execute e2e-test
cd src/integration/js
protractor protractor.conf.js
cd ../../..
# stop webdriver and jetty
kill $WEBDRIVER_PID
kill $JETTY_PID
# clear database files
rm -rf lunchydb.*