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
·50 lines (45 loc) · 1.4 KB
/
Copy pathrun-tests.sh
File metadata and controls
executable file
·50 lines (45 loc) · 1.4 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
49
50
#!/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..."
# Use appium-X.X, to choose a specific Appium server version. More about supported versions at
# https://support.smartbear.com/bitbar/docs/en/mobile-app-tests/automated-testing/appium-support.html
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