forked from appium/appium-uiautomator2-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
110 lines (107 loc) · 3.59 KB
/
.travis.yml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
language: android
dist: trusty
jdk: oraclejdk8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
android:
components:
- platform-tools
- tools
- build-tools
licenses:
- android-sdk-preview-license-.+
- android-sdk-license-.+
- google-gdk-license-.+
env:
global:
- DEVICE=android
- START_EMU=1
- EMU_NAME=test
- EMU_ABI=x86
- EMU_TAG=default
- EMU_TARGET=android-26
- BUILD_TOOLS=28.0.3
- API_TARGET=android-28
- QEMU_AUDIO_DRV=none
- E2E_TEST_PACKAGE=io.appium.uiautomator2.unittest.test
- CC=gcc-6 CXX=g++-6
matrix:
- TEST=unit START_EMU=0
- TEST=AlertCommandsTest
- TEST=ActionsCommandsTest
- TEST=GestureCommandsTest
- TEST=DeviceCommandsTest
- TEST=ElementCommandsTest
- TEST=GestureCommandsTest EMU_TARGET=android-22
- TEST=DeviceCommandsTest EMU_TARGET=android-22
- TEST=ElementCommandsTest EMU_TARGET=android-22
before_install:
- echo $ANDROID_HOME
- |
if [[ -z "${CLOUD}" ]]; then
mkdir -p "${HOME}/.android"
export TOOLS=${ANDROID_HOME}/tools
curl -o "${HOME}/sdk.zip" https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
rm -rf "${TOOLS}"
unzip -o "${HOME}/sdk.zip" -d "$ANDROID_HOME" > /dev/null
rm -f "${HOME}/sdk.zip"
echo yes | sdkmanager --update > /dev/null
echo yes | sdkmanager "build-tools;${BUILD_TOOLS}" "platforms;${API_TARGET}" > /dev/null
if [[ "${START_EMU}" == "1" ]]; then
echo yes | sdkmanager "platform-tools" "platforms;${EMU_TARGET}" "extras;android;m2repository" "extras;google;m2repository" > /dev/null
echo yes | sdkmanager --channel=3 "emulator" > /dev/null
export EMU_IMAGE="system-images;${EMU_TARGET};${EMU_TAG};${EMU_ABI}"
for retry in 1 2 3; do
echo yes | sdkmanager "${EMU_IMAGE}" > /dev/null && break
echo "sdkmanager was not able to download the ${EMU_IMAGE} image (retry ${retry})"
sleep 5
done
sdkmanager --list
export PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
echo no | avdmanager create avd -k "${EMU_IMAGE}" -n "${EMU_NAME}" -f --abi "${EMU_ABI}" --tag "${EMU_TAG}" || exit 1
emulator -avd "${EMU_NAME}" -gpu swiftshader_indirect -no-accel -no-snapshot -no-window -camera-back none -camera-front none -selinux permissive -qemu -m 2048 &
else
sdkmanager --list
fi
fi
install:
# node stuff
- nvm install 10
# npm stuff
- npm install
- npm install appium-test-support
before_script:
- |
if [[ "${START_EMU}" == "1" ]]; then
# make sure emulator started
ls "$(npm bin)"
/bin/bash -x "$(npm bin)/android-emu-travis-post"
fi
script:
- ./gradlew compileServerDebugSources compileServerDebugAndroidTestSources
- |
if [[ "$TEST" == "unit" ]]; then
./gradlew testServerDebugUnitTest
else
stdbuf -oL adb logcat -v time *:S appium:V appium-e2e-tests:V TestRunner:V *:E *:F > logcat.txt &
./gradlew connectedE2eTestDebugAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=$E2E_TEST_PACKAGE.$TEST \
-Pandroid.testInstrumentationRunnerArguments.notAnnotation=$E2E_TEST_PACKAGE.internal.SkipHeadlessDevices
fi
after_failure:
- |
if [[ "$TEST" != "unit" ]]; then
echo -e "----UIAUTOMATOR DUMPS----\n"
adb pull /sdcard/hierarchy .
for f in ./hierarchy/*.xml
do
echo -e "Hierarchy dump for $f\n"
cat "$f"
done
echo -e "\n\n----LOGCAT----\n"
cat logcat.txt
fi