forked from appium/appium-uiautomator2-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
103 lines (94 loc) · 3.12 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
language: android
dist: precise
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
android:
components:
# use the latest revision of Android SDK Tools
- platform-tools
- tools
- build-tools-$ANDROID_BUILD_TOOLS
- android-22
- android-24
# Additional components
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-19
# Specify at least one system image,
# if you need to run emulator(s) during your tests
- sys-img-armeabi-v7a-android-24
- sys-img-armeabi-v7a-android-22
env:
global:
- DEVICE=android
- START_EMU=1
- ANDROID_EMU_NAME=test
- ANDROID_EMU_ABI=armeabi-v7a
- ANDROID_BUILD_TOOLS=26.0.2
- E2E_TEST_PACKAGE=io.appium.uiautomator2.unittest.test
- CC=gcc-4.9 CXX=g++-4.9
matrix:
- TEST=unit START_EMU=0
- TEST=AlertCommandsTest ANDROID_EMU_TARGET=android-24
- TEST=ActionsCommandsTest ANDROID_EMU_TARGET=android-24
- TEST=GestureCommandsTest ANDROID_EMU_TARGET=android-24
- TEST=DeviceCommandsTest ANDROID_EMU_TARGET=android-24
- TEST=ElementCommandsTest ANDROID_EMU_TARGET=android-24
- TEST=GestureCommandsTest ANDROID_EMU_TARGET=android-22
- TEST=DeviceCommandsTest ANDROID_EMU_TARGET=android-22
- TEST=ElementCommandsTest ANDROID_EMU_TARGET=android-22
before_script:
# node stuff
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
- nvm install 8
- node --version
- npm --version
- npm install appium-test-support # get the travis emu scripts
# npm stuff
- npm install
- |
if [ ${START_EMU} = "1" ]; then
# update sdk
echo y | android update sdk --no-ui -t platform-tools
echo y | android update sdk --no-ui -t tools
echo y | android update sdk --no-ui -t ${ANDROID_EMU_TARGET}
# print lists of android sdk and targets
android list sdk --extended --no-ui --all
android list targets
echo no | android create avd --force -n ${ANDROID_EMU_NAME} -t ${ANDROID_EMU_TARGET} --abi ${ANDROID_EMU_ABI} --sdcard 200M
emulator -avd ${ANDROID_EMU_NAME} -no-window &
# make sure emulator started
$(npm bin)/android-emu-travis-post
# get root
adb root
adb devices
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 "----LOGCAT----\n"
cat logcat.txt
fi