forked from microsoft/AppCenter-Test-XCUITest-Extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappcenter.sh
executable file
·91 lines (76 loc) · 1.82 KB
/
appcenter.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env bash
set -e
source "bin/log.sh"
source "bin/xcode.sh"
if [ "$(uname)" != "Darwin" ]; then
error "This script requires macOS"
exit 1
fi
if [ -z ${1} ]; then
echo "Usage: ${0} device-set
This script responds to the following environment variables:
SERIES: the test series; the default series is 'master'"
exit 65
fi
hash npm 2>/dev/null
if [ $? -eq 0 ]; then
info "Using npm $(npm -version)"
else
error "appcenter cli is not installed"
error ""
error "$ brew update; brew install npm"
error "$ npm install -g appcenter-cli"
error ""
error "Then try again"
exit 1
fi
hash appcenter 2>/dev/null
if [ $? -eq 0 ]; then
info "Using $(appcenter --version)"
else
error "appcenter cli is not installed"
error ""
error "$ npm install -g appcenter-cli"
error ""
error "Then try again"
exit 1
fi
CREDS=.appcenter-credentials
if [ ! -e "${CREDS}" ]; then
error "This script requires a ${CREDS} file"
error "Generating a template now:"
cat >${CREDS} <<EOF
export APPCENTER_TOKEN=
export APP=
EOF
cat ${CREDS}
error "Create a token by running:"
error ""
error "$ appcenter login"
error ""
error "and following the instructions."
error ""
error "The APP will be something like josmoo/Flowers."
error "That is <username>/<app name> as they appear in AppCenter."
error ""
error "Update the file with your credentials and run again."
exit 1
fi
source "${CREDS}"
WORKSPACE="Products/Flowers/arm/$(xcode_version)/UITests"
set -e
if [ ! -e "${WORKSPACE}" ]; then
bin/make/build-for-testing.sh arm
else
info "Using existing workspace: ${WORKSPACE}"
fi
if [ "${SERIES}" = "" ]; then
SERIES=master
fi
appcenter test run xcuitest \
--app "${APP}" \
--devices "${1}" \
--build-dir "${WORKSPACE}" \
--test-series "${SERIES}" \
--token "${APPCENTER_TOKEN}" \
--disable-telemetry