forked from bitbar/test-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-tests_ios.sh
More file actions
executable file
·73 lines (59 loc) · 2.11 KB
/
Copy pathrun-tests_ios.sh
File metadata and controls
executable file
·73 lines (59 loc) · 2.11 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# Name of the test file
TEST=${TEST:="BitbarSampleAppTest.py"}
echo "Extracting tests.zip..."
unzip -o tests.zip
#########################################################
#
# Intalling PIP and required Python libraries
# - required libraries are in requirement.txt file that
# is uploaded with this script file
#
#########################################################
echo "Installing pip"
curl https://bootstrap.pypa.io/get-pip.py | python - --user
echo "Exporting PATH for pip"
export PATH=/Users/testdroid/Library/Python/2.7/bin:${PATH}
echo "New PATH: ${PATH}"
echo "Installing requirements from requirements.txt"
chmod 0755 requirements.txt
pip install --user --requirement requirements.txt
#########################################################
#
# Preparing to start Appium
# - UDID is the device ID on which test will run and
# required parameter on iOS test runs
# - appium - is a wrapper tha calls the latest installed
# Appium server. Additional parameters can be passed
# to the server here.
#
#########################################################
echo "UDID set to ${IOS_UDID}"
echo "Starting Appium ..."
appium -U ${IOS_UDID} --log-no-colors --log-timestamp --command-timeout 120
#########################################################
#
# Setting of environment variables used later in test
# - used for Appium desired capabilities
# - note, APPIUM_URL is same for local and cloud server
# runs
#########################################################
export APPIUM_APPFILE="$PWD/application.ipa"
export APPIUM_URL="http://localhost:4723/wd/hub"
export APPIUM_DEVICE="Local Device"
export APPIUM_PLATFORM="IOS"
export APPIUM_AUTOMATION="XCUITest"
## Clean local screenshots directory
rm -rf screenshots
## Start test execution
echo "Running test ${TEST}"
python ${TEST}
#########################################################
#
# Get test report
# - do any test result post processing your test results
# need here
# - also any additional files can be retrieved here
# - retrieve files from device
#########################################################
mv test-reports/*.xml TEST-all.xml