Skip to content

Commit c7e6876

Browse files
author
Zdravko
authored
Merge pull request #8 from NativeScript/zbranzov/tests
Zbranzov/tests
2 parents 56b4f31 + fff7d03 commit c7e6876

35 files changed

+1390
-177
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ demo-vue/platforms/
2525
/src/*.tgz
2626
/publish/package/*.tgz
2727
/publish/package/**/*
28-
/publish/src/**/*
28+
/publish/src/**/*
29+
test-results.xml
30+
**/reports/**/*
31+
**/mochawesome-report/**/*

.travis.yml

Lines changed: 74 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@ env:
33
- ANDROID_PACKAGE_JS='picker-debug-js.apk'
44
- ANDROID_PACKAGE_NG='picker-debug-ng.apk'
55
- ANDROID_PACKAGE_VUE='picker-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"
6+
- PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/outputs
7+
- PACKAGE_FOLDER_NG=$TRAVIS_BUILD_DIR/demo-angular/outputs
8+
- PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/outputs
9+
- SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER"
1010
- IOS_PACKAGE_JS='picker-demo-js.zip'
1111
- IOS_PACKAGE_NG='picker-demo-ng.zip'
1212
- IOS_PACKAGE_VUE='picker-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"
1713

1814
git:
1915
depth: 1
@@ -28,9 +24,7 @@ matrix:
2824
os: linux
2925
node_js: "8"
3026
script:
31-
- cd src && npm run ci.tslint
32-
- cd ../demo && npm run ci.tslint
33-
- cd ../demo-angular && npm run ci.tslint
27+
- cd src && npm i && npm run tslint
3428

3529
- stage: "WebPack and Build"
3630
os: osx
@@ -45,8 +39,8 @@ matrix:
4539
script:
4640
- cd src && npm run build
4741
- 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"
42+
- cd $PACKAGE_FOLDER_JS && zip -r $IOS_PACKAGE_JS demo.app
43+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$IOS_PACKAGE_JS?overwrite=true --data-binary @$PACKAGE_FOLDER_JS/$IOS_PACKAGE_JS"
5044
- os: osx
5145
env:
5246
- WebpackiOS="12.0"
@@ -59,8 +53,8 @@ matrix:
5953
script:
6054
- cd src && npm run build
6155
- 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"
56+
- cd $PACKAGE_FOLDER_VUE && zip -r $IOS_PACKAGE_VUE demovue.app
57+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$IOS_PACKAGE_VUE?overwrite=true --data-binary @$PACKAGE_FOLDER_VUE/$IOS_PACKAGE_VUE"
6458
- os: osx
6559
env:
6660
- WebpackiOS="12.0"
@@ -74,8 +68,8 @@ matrix:
7468
- cd src && npm run build && npm pack
7569
- cd ../demo-angular && tns plugin add ../src/*.tgz
7670
- 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"
71+
- cd $PACKAGE_FOLDER_NG && zip -r $IOS_PACKAGE_NG demoangular.app
72+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$IOS_PACKAGE_NG?overwrite=true --data-binary @$PACKAGE_FOLDER_NG/$IOS_PACKAGE_NG"
7973
- language: android
8074
os: linux
8175
env:
@@ -86,7 +80,7 @@ matrix:
8680
script:
8781
- cd src && npm run build
8882
- 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"
83+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$ANDROID_PACKAGE_JS?overwrite=true --data-binary @$PACKAGE_FOLDER_JS/app-debug.apk"
9084
- language: android
9185
os: linux
9286
env:
@@ -97,7 +91,7 @@ matrix:
9791
script:
9892
- cd src && npm run build
9993
- 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"
94+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$ANDROID_PACKAGE_VUE?overwrite=true --data-binary @$PACKAGE_FOLDER_VUE/app-debug.apk"
10195
- language: android
10296
os: linux
10397
env:
@@ -110,17 +104,7 @@ matrix:
110104
- cd ../publish && sh pack.sh
111105
- cd ../demo-angular && tns plugin add ../publish/package/*.tgz
112106
- 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:
116-
- BuildAndroid="28"
117-
- Type="VanillaJS"
118-
os: linux
119-
jdk: oraclejdk8
120-
before_install: nvm install 8.11.4
121-
script:
122-
- cd src && npm run build
123-
- cd ../demo && tns build android
107+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$ANDROID_PACKAGE_NG?overwrite=true --data-binary @$PACKAGE_FOLDER_NG/app-debug.apk"
124108
- language: android
125109
env:
126110
- BuildAndroid="28"
@@ -135,49 +119,78 @@ matrix:
135119
env:
136120
- BuildiOS="12.0"
137121
- Xcode="10.0"
138-
- Type="VanillaJS"
122+
- Type="Angular"
139123
osx_image: xcode10.0
140124
language: node_js
141125
node_js: "8"
142126
jdk: oraclejdk8
143127
before_script: pod repo update
144128
script:
145129
- cd src && npm run build
146-
- cd ../demo && tns build ios --bundle --env.uglify
147-
- os: osx
130+
- cd ../demo-angular && tns build ios
131+
- stage: "UI Tests"
148132
env:
149-
- BuildiOS="12.0"
150-
- Xcode="10.0"
133+
- Android="24"
151134
- Type="Angular"
152-
osx_image: xcode10.0
153135
language: node_js
136+
os: linux
154137
node_js: "8"
155-
jdk: oraclejdk8
156-
before_script: pod repo update
157138
script:
158-
- cd src && npm run build
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-ng && npm i
180-
# - travis_wait travis_retry npm run e2e -- --runType sim.iPhoneX --sauceLab --appPath $IOS_PACKAGE_NG
139+
- npm i -g appium
140+
- cd demo-angular && npm i
141+
- travis_wait travis_retry npm run e2e -- --runType android24.sauce --sauceLab --appPath $ANDROID_PACKAGE_NG
142+
- os: linux
143+
env:
144+
- iOS="12.0"
145+
- Type="Angular"
146+
language: node_js
147+
node_js: "8"
148+
script:
149+
- npm i -g appium
150+
- cd demo-angular && npm i
151+
- travis_wait travis_retry npm run e2e -- --runType sim.iPhoneX.ios12.sauce --sauceLab --appPath $IOS_PACKAGE_NG
152+
- os: linux
153+
env:
154+
- Android="24"
155+
- Type="VueJS"
156+
language: node_js
157+
os: linux
158+
node_js: "8"
159+
script:
160+
- npm i -g appium
161+
- cd demo-vue && npm i
162+
- travis_wait travis_retry npm run e2e -- --runType android24.sauce --sauceLab --appPath $ANDROID_PACKAGE_VUE
163+
- os: linux
164+
env:
165+
- iOS="12.0"
166+
- Type="VueJS"
167+
language: node_js
168+
node_js: "8"
169+
script:
170+
- npm i -g appium
171+
- cd demo-vue && npm i
172+
- travis_wait travis_retry npm run e2e -- --runType sim.iPhoneX.ios12.sauce --sauceLab --appPath $IOS_PACKAGE_VUE
173+
- os: linux
174+
env:
175+
- Android="24"
176+
- Type="VanillaJS"
177+
language: node_js
178+
os: linux
179+
node_js: "8"
180+
script:
181+
- npm i -g appium
182+
- cd demo && npm i
183+
- travis_wait travis_retry npm run e2e -- --runType android24.sauce --sauceLab --appPath $ANDROID_PACKAGE_JS
184+
- os: linux
185+
env:
186+
- iOS="12.0"
187+
- Type="VanillaJS"
188+
language: node_js
189+
node_js: "8"
190+
script:
191+
- npm i -g appium
192+
- cd demo && npm i
193+
- travis_wait travis_retry npm run e2e -- --runType sim.iPhoneX.ios12.sauce --sauceLab --appPath $IOS_PACKAGE_JS
181194

182195
android:
183196
components:
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
{
2+
"android23": {
3+
"platformName": "Android",
4+
"platformVersion": "6.0",
5+
"deviceName": "Android",
6+
"lt": 60000,
7+
"appActivity": "com.tns.NativeScriptActivity",
8+
"newCommandTimeout": 720,
9+
"noReset": true,
10+
"fullReset": false,
11+
"app": ""
12+
},
13+
"android24": {
14+
"platformName": "Android",
15+
"platformVersion": "7.0",
16+
"deviceName": "Emulator-Api24-Google",
17+
"avd":"Emulator-Api24-Google",
18+
"lt": 60000,
19+
"newCommandTimeout": 720,
20+
"appium-version": "1.8.1",
21+
"appActivity": "com.tns.NativeScriptActivity",
22+
"noReset": true,
23+
"fullReset": false,
24+
"app": "",
25+
"automationName": "Appium",
26+
"density": 3.2,
27+
"offsetPixels": 51
28+
},
29+
"android24.sauce": {
30+
"platformName": "Android",
31+
"platformVersion": "7.0",
32+
"deviceName": "Android GoogleAPI Emulator",
33+
"lt": 60000,
34+
"newCommandTimeout": 720,
35+
"appiumVersion": "1.9.1",
36+
"noReset": true,
37+
"fullReset": false,
38+
"app": "",
39+
"idleTimeout": 120,
40+
"automationName": "Appium"
41+
},
42+
"android25": {
43+
"platformName": "Android",
44+
"platformVersion": "7.1",
45+
"deviceName": "Google Pixel GoogleAPI",
46+
"lt": 60000,
47+
"appActivity": "com.tns.NativeScriptActivity",
48+
"newCommandTimeout": 720,
49+
"noReset": true,
50+
"fullReset": false,
51+
"app": ""
52+
},
53+
"android27": {
54+
"platformName": "Android",
55+
"platformVersion": "8.1",
56+
"deviceName": "Emulator-Api27-Google",
57+
"lt": 60000,
58+
"appActivity": "com.tns.NativeScriptActivity",
59+
"newCommandTimeout": 720,
60+
"noReset": true,
61+
"fullReset": false,
62+
"app": ""
63+
},
64+
"sim.iPhoneX.iOS112": {
65+
"platformName": "iOS",
66+
"platformVersion": "11.2",
67+
"deviceName": "iPhone X",
68+
"appium-version": "1.8.0",
69+
"density": 3,
70+
"offsetPixels": 87,
71+
"noReset": true,
72+
"fullReset": false,
73+
"app": ""
74+
},
75+
"sim.iPhoneX.iOS113": {
76+
"platformName": "iOS",
77+
"platformVersion": "11.3",
78+
"deviceName": "iPhone X",
79+
"appium-version": "1.8.0",
80+
"density": 3,
81+
"offsetPixels": 87,
82+
"noReset": true,
83+
"fullReset": false,
84+
"app": ""
85+
},
86+
"sim.iPhoneX.ios11": {
87+
"platformName": "iOS",
88+
"platformVersion": "11.2",
89+
"deviceName": "iPhone X",
90+
"appium-version": "1.8.1",
91+
"noReset": true,
92+
"fullReset": false,
93+
"app": "",
94+
"idleTimeout": 120,
95+
"automationName": "Appium"
96+
},
97+
"sim.iPhoneX.ios12": {
98+
"platformName": "iOS",
99+
"platformVersion": "12.1",
100+
"deviceName": "iPhone X",
101+
"appiumVersion": "1.9.1",
102+
"noReset": true,
103+
"fullReset": false,
104+
"density": 3,
105+
"offsetPixels": 87,
106+
"app": "",
107+
"idleTimeout": 120,
108+
"automationName": "Appium"
109+
},
110+
"sim.iPhoneX.ios12.sauce": {
111+
"platformName": "iOS",
112+
"platformVersion": "12.0",
113+
"deviceName": "iPhone X",
114+
"appium-version": "1.9.1",
115+
"noReset": true,
116+
"fullReset": false,
117+
"density": 3,
118+
"offsetPixels": 87,
119+
"app": "",
120+
"idleTimeout": 120,
121+
"automationName": "Appium"
122+
}
123+
}

demo-angular/e2e/config/mocha.opts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--timeout 250000
2+
--recursive e2e
3+
--reporter mocha-multi
4+
--reporter-options mochawesome=-,mocha-junit-reporter=test-results.xml
5+
--exit

0 commit comments

Comments
 (0)