forked from bitbar/test-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-tests.sh
More file actions
executable file
·48 lines (43 loc) · 1.21 KB
/
Copy pathrun-tests.sh
File metadata and controls
executable file
·48 lines (43 loc) · 1.21 KB
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
#!/bin/bash
startAppium(){
if [ "$(uname)" == "Darwin" ]; then
startAppiumOSX
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
startAppiumLinux
else
echo "Unknown OS system, exiting..."
exit 1
fi
}
startAppiumOSX(){
if [ -z ${UDID} ] ; then
export UDID=${IOS_UDID}
fi
echo "UDID is ${UDID}"
# Create the screenshots directory, if it doesn't exist'
mkdir -p .screenshots
echo "Starting Appium on Mac..."
export AUTOMATION_NAME="XCUITest"
appium -U ${UDID} --log-no-colors --log-timestamp
}
startAppiumLinux(){
# Create the screenshots directory, if it doesn't exist'
mkdir -p .screenshots
echo "Starting Appium on Linux..."
appium --log-no-colors --log-timestamp
}
executeTests(){
echo "Extracting tests.zip..."
unzip tests.zip
if [ "$(uname)" == "Darwin" ]; then
echo "Running iOS Tests..."
mvn clean test -Dtest=IosAppiumExampleTest -DexecutionType=serverside
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
echo "Running Android Tests..."
mvn clean test -Dtest=AndroidAppiumExampleTest -DexecutionType=serverside
fi
echo "Finished Running Tests!"
cp target/surefire-reports/junitreports/TEST-*.xml TEST-all.xml
}
startAppium
executeTests