Skip to content

Commit fa820ac

Browse files
Merge pull request #6 from NativeScript/dtodorov/add-ui-tests
Dtodorov/add ui tests
2 parents fe64410 + c58fbc5 commit fa820ac

File tree

14 files changed

+671
-33
lines changed

14 files changed

+671
-33
lines changed

.travis.yml

+146-30
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
env:
2+
global:
3+
- ANDROID_PACKAGE_JS='datetimepicker-debug-js.apk'
4+
- ANDROID_PACKAGE_NG='datetimepicker-debug-ng.apk'
5+
- ANDROID_PACKAGE_VUE='datetimepicker-debug-vue.apk'
6+
- ANDROID_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/outputs
7+
- ANDROID_PACKAGE_FOLDER_NG=$TRAVIS_BUILD_DIR/demo-angular/outputs
8+
- ANDROID_PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/outputs
9+
- ANDROID_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER"
10+
- IOS_PACKAGE_JS='datetimepicker-demo-js.zip'
11+
- IOS_PACKAGE_NG='datetimepicker-demo-ng.zip'
12+
- IOS_PACKAGE_VUE='datetimepicker-demo-vue.zip'
13+
- IOS_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/outputs
14+
- IOS_PACKAGE_FOLDER_NG=$TRAVIS_BUILD_DIR/demo-angular/outputs
15+
- IOS_PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/outputs
16+
- IOS_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER"
17+
18+
git:
19+
depth: 1
20+
121
branches:
222
only:
323
- master
@@ -12,56 +32,152 @@ matrix:
1232
- cd ../demo && npm run ci.tslint
1333
- cd ../demo-angular && npm run ci.tslint
1434

15-
- stage: "build demos"
35+
- stage: "WebPack and Build"
36+
os: osx
37+
env:
38+
- WebpackiOS="12.0"
39+
- Type="VanillaJS"
40+
osx_image: xcode10.0
41+
language: node_js
42+
node_js: "8"
43+
jdk: oraclejdk8
44+
before_script: pod repo update
45+
script:
46+
- cd src && npm run build
47+
- cd ../demo && npm i && tns build ios --bundle --env.uglify --copy-to "./outputs/demo.app"
48+
- cd $IOS_PACKAGE_FOLDER_JS && zip -r $IOS_PACKAGE_JS demo.app
49+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_JS?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_JS/$IOS_PACKAGE_JS"
50+
- os: osx
51+
env:
52+
- WebpackiOS="12.0"
53+
- Type="VueJS"
54+
osx_image: xcode10.0
55+
language: node_js
56+
node_js: "8"
57+
jdk: oraclejdk8
58+
before_script: pod repo update
59+
script:
60+
- cd src && npm run build
61+
- cd ../demo-vue && npm i && tns build ios --bundle --env.uglify --copy-to "./outputs/demovue.app"
62+
- cd $IOS_PACKAGE_FOLDER_VUE && zip -r $IOS_PACKAGE_VUE demovue.app
63+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_VUE?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_VUE/$IOS_PACKAGE_VUE"
64+
- os: osx
65+
env:
66+
- WebpackiOS="12.0"
67+
- Type="Angular"
68+
osx_image: xcode10.0
69+
language: node_js
70+
node_js: "8"
71+
jdk: oraclejdk8
72+
before_script: pod repo update
73+
script:
74+
- cd src && npm run build && npm pack
75+
- cd ../demo-angular && tns plugin add ../src/*.tgz
76+
- npm i && tns build ios --bundle --env.uglify --env.aot --copy-to "./outputs/demoangular.app"
77+
- cd $IOS_PACKAGE_FOLDER_NG && zip -r $IOS_PACKAGE_NG demoangular.app
78+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_NG?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_NG/$IOS_PACKAGE_NG"
79+
- language: android
80+
os: linux
81+
env:
82+
- WebpackAndroid="28"
83+
- Type="VanillaJS"
84+
jdk: oraclejdk8
85+
before_install: nvm install 8
86+
script:
87+
- cd src && npm run build
88+
- cd ../demo && npm i && tns build android --bundle --env.uglify --env.snapshot --copy-to "./outputs/app-debug.apk"
89+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_JS?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_JS/app-debug.apk"
90+
- language: android
1691
os: linux
17-
env:
92+
env:
93+
- WebpackAndroid="28"
94+
- Type="VueJS"
95+
jdk: oraclejdk8
96+
before_install: nvm install 8
97+
script:
98+
- cd src && npm run build
99+
- cd ../demo-vue && npm i && tns build android --bundle --env.uglify --copy-to "./outputs/app-debug.apk"
100+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_VUE?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_VUE/app-debug.apk"
101+
- language: android
102+
os: linux
103+
env:
104+
- WebpackAndroid="28"
105+
- Type="Angular"
106+
jdk: oraclejdk8
107+
before_install: nvm install 8
108+
script:
109+
- cd src && npm run build
110+
- cd ../publish && sh pack.sh
111+
- cd ../demo-angular && tns plugin add ../publish/package/*.tgz
112+
- npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot --copy-to "./outputs/app-debug.apk"
113+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_NG?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_NG/app-debug.apk"
114+
- language: android
115+
env:
18116
- BuildAndroid="28"
19-
language: android
117+
- Type="VanillaJS"
118+
os: linux
20119
jdk: oraclejdk8
21120
before_install: nvm install 8.11.4
22-
script:
121+
script:
23122
- cd src && npm run build
24123
- cd ../demo && tns build android
124+
- language: android
125+
env:
126+
- BuildAndroid="28"
127+
- Type="Angular"
128+
os: linux
129+
jdk: oraclejdk8
130+
before_install: nvm install 8.11.4
131+
script:
132+
- cd src && npm run build
25133
- cd ../demo-angular && tns build android
26-
27134
- os: osx
28-
env:
135+
env:
29136
- BuildiOS="12.0"
30137
- Xcode="10.0"
138+
- Type="VanillaJS"
31139
osx_image: xcode10.0
32-
language: node_js
140+
language: node_js
33141
node_js: "8"
34142
jdk: oraclejdk8
35-
script:
36-
- cd src && npm run build
37-
- cd ../demo && tns build ios
38-
- cd ../demo-angular && tns build ios
39-
40-
- stage: "build demos with webpack"
41-
os: linux
42-
language: android
43-
env:
44-
- Webpack="Android"
45-
jdk: oraclejdk8
46-
before_install: nvm install 8.11.4
47-
script:
143+
before_script: pod repo update
144+
script:
48145
- cd src && npm run build
49-
- cd ../demo && tns build android --bundle --env.uglify --env.snapshot --env.aot
50-
- cd ../demo-angular && tns build android --bundle --env.uglify --env.snapshot --env.aot
51-
- cd ../demo-vue && tns build android --bundle --env.uglify --env.snapshot --env.aot
52-
146+
- cd ../demo && tns build ios --bundle --env.uglify
53147
- os: osx
54148
env:
55-
- Webpack="iOS"
149+
- BuildiOS="12.0"
150+
- Xcode="10.0"
151+
- Type="Angular"
56152
osx_image: xcode10.0
57-
language: node_js
153+
language: node_js
58154
node_js: "8"
59155
jdk: oraclejdk8
60-
script:
156+
before_script: pod repo update
157+
script:
61158
- cd src && npm run build
62-
- cd ../demo && tns build ios --bundle --env.uglify --env.aot
63-
- cd ../demo-angular && tns build ios --bundle --env.uglify --env.aot
64-
- cd ../demo-vue && tns build ios --bundle --env.uglify --env.aot
159+
- cd ../demo-angular && tns build ios
160+
- stage: "UI Tests"
161+
env:
162+
- Android="24"
163+
- Type="Angular"
164+
language: node_js
165+
os: linux
166+
node_js: "8"
167+
script:
168+
- npm i -g appium
169+
- cd demo-angular && npm i
170+
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_NG
171+
- os: linux
172+
env:
173+
- iOS="12.0"
174+
- Type="Angular"
175+
language: node_js
176+
node_js: "8"
177+
script:
178+
- npm i -g appium
179+
- cd demo-angular && npm i
180+
- travis_wait travis_retry npm run e2e -- --runType sim.iPhoneX --sauceLab --appPath $IOS_PACKAGE_NG
65181

66182
android:
67183
components:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"android19": {
3+
"platformName": "Android",
4+
"platformVersion": "4.4",
5+
"deviceName": "Emulator-Api19-Default",
6+
"avd": "Emulator-Api19-Default",
7+
"lt": 60000,
8+
"newCommandTimeout": 720,
9+
"noReset": false,
10+
"fullReset": false,
11+
"app": ""
12+
},
13+
"android21": {
14+
"platformName": "Android",
15+
"platformVersion": "5.0",
16+
"deviceName": "Emulator-Api21-Default",
17+
"avd": "Emulator-Api21-Default",
18+
"lt": 60000,
19+
"newCommandTimeout": 720,
20+
"noReset": false,
21+
"fullReset": false,
22+
"app": ""
23+
},
24+
"android23": {
25+
"platformName": "Android",
26+
"platformVersion": "6.0",
27+
"deviceName": "Emulator-Api23-Default",
28+
"avd": "Emulator-Api23-Default",
29+
"lt": 60000,
30+
"newCommandTimeout": 720,
31+
"noReset": false,
32+
"fullReset": false,
33+
"app": ""
34+
},
35+
"android24": {
36+
"platformName": "Android",
37+
"platformVersion": "7.0",
38+
"deviceName": "Android GoogleAPI Emulator",
39+
"lt": 60000,
40+
"newCommandTimeout": 720,
41+
"appium-version": "1.9.1",
42+
"noReset": true,
43+
"fullReset": false,
44+
"app": "",
45+
"idleTimeout": 120,
46+
"automationName": "Appium"
47+
},
48+
"android25": {
49+
"platformName": "Android",
50+
"platformVersion": "7.1",
51+
"deviceName": "Emulator-Api25-Google",
52+
"avd": "Emulator-Api25-Google",
53+
"lt": 60000,
54+
"newCommandTimeout": 720,
55+
"noReset": false,
56+
"fullReset": false,
57+
"app": ""
58+
},
59+
"android26": {
60+
"platformName": "Android",
61+
"platformVersion": "8.0",
62+
"deviceName": "Emulator-Api26-Google",
63+
"avd": "Emulator-Api26-Google",
64+
"lt": 60000,
65+
"newCommandTimeout": 720,
66+
"noReset": false,
67+
"fullReset": false,
68+
"app": ""
69+
},
70+
"android27": {
71+
"platformName": "Android",
72+
"platformVersion": "27",
73+
"deviceName": "Emulator-Api27-Google",
74+
"avd": "Emulator-Api27-Google",
75+
"lt": 60000,
76+
"newCommandTimeout": 720,
77+
"noReset": false,
78+
"fullReset": false,
79+
"app": ""
80+
},
81+
"android28": {
82+
"platformName": "Android",
83+
"platformVersion": "28",
84+
"deviceName": "Emulator-Api28-Google",
85+
"avd": "Emulator-Api28-Google",
86+
"lt": 60000,
87+
"newCommandTimeout": 720,
88+
"noReset": false,
89+
"fullReset": false,
90+
"app": ""
91+
},
92+
"sim.iPhone7": {
93+
"platformName": "iOS",
94+
"platformVersion": "/12.*/",
95+
"deviceName": "iPhone 7",
96+
"noReset": false,
97+
"fullReset": false,
98+
"app": ""
99+
},
100+
"sim.iPhone8": {
101+
"platformName": "iOS",
102+
"platformVersion": "/12*/",
103+
"deviceName": "iPhone 8",
104+
"noReset": false,
105+
"fullReset": false,
106+
"app": ""
107+
},
108+
"sim.iPhoneX": {
109+
"platformName": "iOS",
110+
"platformVersion": "12.0",
111+
"deviceName": "iPhone X",
112+
"appium-version": "1.9.1",
113+
"app": "",
114+
"noReset": true,
115+
"fullReset": false,
116+
"density": 3,
117+
"offsetPixels": 87,
118+
"idleTimeout": 120,
119+
"automationName": "Appium"
120+
},
121+
"sim.iPhoneXS": {
122+
"platformName": "ios",
123+
"platformVersion": "/12*/",
124+
"deviceName": "iPhone XS",
125+
"noReset": false,
126+
"fullReset": false,
127+
"app": ""
128+
}
129+
}

demo-angular/e2e/config/mocha.opts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--timeout 999999
2+
--recursive e2e
3+
--reporter mocha-multi
4+
--reporter-options mochawesome=-,mocha-junit-reporter=test-results.xml
5+
--exit

0 commit comments

Comments
 (0)