forked from paypal/docker-selion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsa-test.sh
executable file
·51 lines (42 loc) · 1.09 KB
/
sa-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
#!/usr/bin/env bash
VERSION=${VERSION-develop}
SELION_VERSION=${SELION_VERSION}
function build_test_container {
echo Building test container image
docker build -t selion/smoketest:$VERSION ./test
}
function teardown {
echo Tearing down Selion standalone-$BROWSER container
docker stop $SA_NAME
docker rm $SA_NAME
echo Removing the test container
docker rm $TEST_CONTAINER
}
function test_standalone {
BROWSER=$1
echo Starting Selion standalone-$BROWSER container
SA=$(docker run -d selion/standalone-$BROWSER:$VERSION)
sleep 2
SA_NAME=$(docker inspect -f '{{ .Name }}' $SA | sed s:/::)
echo Running test container...
docker run -it -v /dev/shm:/dev/shm --link $SA_NAME:hub \
-e BROWSER=$BROWSER \
-e TEST_SUITE=StandaloneSuite.xml \
-e SELION_VERSION=$SELION_VERSION \
selion/smoketest:$VERSION
STATUS=$?
TEST_CONTAINER=$(docker ps -aq | head -1)
if [ ! $STATUS == 0 ]; then
echo Failed
teardown
exit 1
fi
teardown
}
#-------------
# main
#-------------
build_test_container
test_standalone firefox
test_standalone chrome
test_standalone phantomjs