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
41 lines (22 loc) · 880 Bytes
/
Copy pathrun-tests_ios.sh
File metadata and controls
41 lines (22 loc) · 880 Bytes
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
#!/bin/bash
TEST=${TEST:="ios_sample_spec.rb"} # Name of the test file
##### Cloud testrun dependencies start
echo "Extracting tests.zip..."
unzip tests.zip
## Environment variables setup
export CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
export SCREENSHOT_FOLDER=target/reports/screenshots/
echo "Setting UDID..."
echo "UDID set to ${IOS_UDID}"
echo "Starting Appium ..."
appium --log-no-colors --log-timestamp
ps -ef|grep appium
##### Cloud testrun dependencies end.
## Run the test:
bundle install
echo "Running test ${TEST}"
# Make sure there's no pre-existing `screenshots` files
rm -rf screenshots
bundle exec rspec ${TEST} --format RspecJunitFormatter --out TEST-all.xml
# Screenshots need to be available at root as directory `screenshots` .
cp -a ${SCREENSHOT_FOLDER}. screenshots/