Skip to content

Commit db3def0

Browse files
Zdravkoelena-p
authored andcommitted
Zbranzov/common tests (#203)
* chore: use common tests for all apps
1 parent 73ab51b commit db3def0

File tree

21 files changed

+107
-456
lines changed

21 files changed

+107
-456
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ demo-angular/platforms/
2121
/src/platforms/android/nativescript_facebook.aar
2222
/src/*.tgz
2323
/publish/package/*.tgz
24-
/publish/package/**/*
24+
/publish/package/**/*
25+
test-results.xml
26+
**/outputs
27+
**/mochawesome-report
28+
tests/e2e/reports

.travis.yml

Lines changed: 40 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ env:
55
global:
66
- ANDROID_PACKAGE_JS='facebook-debug-js.apk'
77
- ANDROID_PACKAGE_VUE='facebook-debug-vue.apk'
8+
- ANDROID_PACKAGE_NG='facebook-debug-ng.apk'
89
- ANDROID_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/outputs
910
- ANDROID_PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/outputs
10-
- ANDROID_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER"
11+
- ANDROID_PACKAGE_FOLDER_NG=$TRAVIS_BUILD_DIR/demo-angular/outputs
12+
- SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER"
1113
- IOS_PACKAGE_JS='facebook-demo-js.zip'
1214
- IOS_PACKAGE_VUE='facebook-demo-vue.zip'
15+
- IOS_PACKAGE_NG='facebook-demo-ng.zip'
1316
- IOS_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/outputs
1417
- IOS_PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/outputs
15-
- IOS_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER"
18+
- IOS_PACKAGE_FOLDER_NG=$TRAVIS_BUILD_DIR/demo-angular/outputs
1619

1720
matrix:
1821
include:
@@ -21,7 +24,7 @@ matrix:
2124
os: linux
2225
node_js: "10"
2326
script: cd src && npm run ci.tslint && cd ../demo && npm run ci.tslint && cd ../demo-angular && npm run ci.tslint
24-
- stage: "WebPack and Build"
27+
- stage: "WebPack"
2528
os: osx
2629
env:
2730
- WebpackiOS="12.0"
@@ -35,7 +38,7 @@ matrix:
3538
- cd src && npm run build.iosOnly
3639
- cd ../demo && npm i && tns build ios --bundle --env.uglify --copy-to "./outputs/demo.app"
3740
- cd $IOS_PACKAGE_FOLDER_JS && zip -r $IOS_PACKAGE_JS demo.app
38-
- "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"
41+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$IOS_PACKAGE_JS?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_JS/$IOS_PACKAGE_JS"
3942
- os: osx
4043
env:
4144
- WebpackiOS="12.0"
@@ -49,7 +52,7 @@ matrix:
4952
- cd src && npm run build.iosOnly
5053
- cd ../demo-vue && npm i && tns build ios --bundle --env.uglify --copy-to "./outputs/demovue.app"
5154
- cd $IOS_PACKAGE_FOLDER_VUE && zip -r $IOS_PACKAGE_VUE demovue.app
52-
- "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"
55+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$IOS_PACKAGE_VUE?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_VUE/$IOS_PACKAGE_VUE"
5356
- os: osx
5457
env:
5558
- WebpackiOS="12.0"
@@ -62,7 +65,9 @@ matrix:
6265
script:
6366
- cd src && npm run build.iosOnly && npm pack
6467
- cd ../demo-angular && tns plugin add ../src/*.tgz
65-
- npm i && tns build ios --bundle --env.uglify --env.aot
68+
- npm i && tns build ios --bundle --env.uglify --env.aot --copy-to "./outputs/demoangular.app"
69+
- cd $IOS_PACKAGE_FOLDER_NG && zip -r $IOS_PACKAGE_NG demoangular.app
70+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$IOS_PACKAGE_NG?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_NG/$IOS_PACKAGE_NG"
6671
- language: android
6772
os: linux
6873
dist: trusty
@@ -74,7 +79,7 @@ matrix:
7479
script:
7580
- cd src && npm run build
7681
- cd ../demo && npm i && tns build android --bundle --env.uglify --env.snapshot --copy-to "./outputs/app-debug.apk"
77-
- "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"
82+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$ANDROID_PACKAGE_JS?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_JS/app-debug.apk"
7883
- language: android
7984
os: linux
8085
dist: trusty
@@ -86,7 +91,7 @@ matrix:
8691
script:
8792
- cd src && npm run build
8893
- cd ../demo-vue && npm i && tns build android --bundle --env.uglify --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_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 @$ANDROID_PACKAGE_FOLDER_VUE/app-debug.apk"
9095
- language: android
9196
os: linux
9297
dist: trusty
@@ -99,53 +104,8 @@ matrix:
99104
- cd src && npm run build
100105
- cd ../publish && sh pack.sh
101106
- cd ../demo-angular && tns plugin add ../publish/package/*.tgz
102-
- npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot
103-
- language: android
104-
os: linux
105-
dist: trusty
106-
env:
107-
- BuildAndroid="28"
108-
- Type="VanillaJS"
109-
110-
jdk: oraclejdk8
111-
before_install: nvm install 10
112-
script:
113-
- cd demo && npm run ci.android.build
114-
- language: android
115-
os: linux
116-
dist: trusty
117-
env:
118-
- BuildAndroid="28"
119-
- Type="Angular"
120-
121-
jdk: oraclejdk8
122-
before_install: nvm install 10
123-
script:
124-
- cd demo-angular && npm run ci.android.build
125-
- os: osx
126-
env:
127-
- BuildiOS="12.0"
128-
- Xcode="10.0"
129-
- Type="VanillaJS"
130-
osx_image: xcode10.2
131-
language: node_js
132-
node_js: "10"
133-
jdk: oraclejdk8
134-
before_script: pod repo update
135-
script:
136-
- cd demo && npm run ci.ios.build
137-
- os: osx
138-
env:
139-
- BuildiOS="12.0"
140-
- Xcode="10.0"
141-
- Type="Angular"
142-
osx_image: xcode10.2
143-
language: node_js
144-
node_js: "10"
145-
jdk: oraclejdk8
146-
before_script: pod repo update
147-
script:
148-
- cd demo-angular && npm run ci.ios.build
107+
- npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot --copy-to "./outputs/app-debug.apk"
108+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $SAUCE_STORAGE/$ANDROID_PACKAGE_NG?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_NG/app-debug.apk"
149109
- stage: "UI Tests"
150110
env:
151111
- Android="24"
@@ -155,7 +115,7 @@ matrix:
155115
node_js: "10"
156116
script:
157117
- npm i -g appium
158-
- cd demo && npm i
118+
- cd tests && npm i
159119
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_JS
160120
- os: linux
161121
env:
@@ -166,7 +126,7 @@ matrix:
166126
node_js: "10"
167127
script:
168128
- npm i -g appium
169-
- cd demo-vue && npm i
129+
- cd tests && npm i
170130
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_VUE
171131
- os: linux
172132
env:
@@ -176,7 +136,7 @@ matrix:
176136
node_js: "10"
177137
script:
178138
- npm i -g appium
179-
- cd demo && npm i
139+
- cd tests && npm i
180140
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_JS
181141
- os: linux
182142
env:
@@ -186,8 +146,29 @@ matrix:
186146
node_js: "10"
187147
script:
188148
- npm i -g appium
189-
- cd demo-vue && npm i
149+
- cd tests && npm i
190150
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_VUE
151+
- os: linux
152+
env:
153+
- Android="24"
154+
- Type="Angular"
155+
language: node_js
156+
os: linux
157+
node_js: "10"
158+
script:
159+
- npm i -g appium
160+
- cd tests && npm i
161+
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_NG
162+
- os: linux
163+
env:
164+
- iOS="12.0"
165+
- Type="Angular"
166+
language: node_js
167+
node_js: "10"
168+
script:
169+
- npm i -g appium
170+
- cd tests && npm i
171+
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_NG
191172

192173
android:
193174
components:

demo-angular/app/pages/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</StackLayout>
99
<StackLayout class="buttons">
1010
<FacebookLoginButton (logout)="onLogout($event)"></FacebookLoginButton>
11-
<Button text="Log out (custom)" (tap)="logout()"></Button>
11+
<Button text="Log out (Custom)" (tap)="logout()" automationText="customLogOut"></Button>
1212
<Button text="Get current access token" (tap)="getCurrentAccessToken()"></Button>
1313
</StackLayout>
1414
<StackLayout class="buttons">

demo-angular/app/pages/login/login.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<StackLayout class="login-buttons">
22
<FacebookLoginButton (login)="onLogin($event)"></FacebookLoginButton>
3-
<Button text="Continue with Facebook (custom)" (tap)="login()"></Button>
3+
<Button text="Continue with Facebook (Custom)" (tap)="login()" automationText="facebookCustom"></Button>
44
<Button text="Get current access token" (tap)="getCurrentAccessToken()"></Button>
55

66
<FacebookShareButton [content] = "linkContent"></FacebookShareButton>

demo-angular/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
"zone.js": "^0.8.4"
2929
},
3030
"devDependencies": {
31-
"jasmine-core": "^2.5.2",
32-
"karma": "^1.3.0",
33-
"karma-jasmine": "^1.0.2",
34-
"karma-nativescript-launcher": "^0.4.0",
3531
"nativescript-css-loader": "~0.26.0",
3632
"nativescript-dev-typescript": "~0.9.0",
3733
"nativescript-dev-webpack": "~0.22.0",

demo-vue/package.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,14 @@
2020
"devDependencies": {
2121
"@babel/core": "~7.1.0",
2222
"@babel/preset-env": "~7.1.0",
23-
"@types/chai": "^4.1.3",
24-
"@types/mocha": "^5.2.0",
25-
"@types/node": "^10.1.2",
2623
"babel-loader": "~8.0.0",
27-
"chai": "~4.1.2",
28-
"chai-as-promised": "~7.1.1",
29-
"karma": "^2.0.2",
30-
"karma-nativescript-launcher": "^0.4.0",
31-
"mocha": "^3.3.0",
32-
"mocha-junit-reporter": "^1.18.0",
33-
"mocha-multi": "^1.0.1",
34-
"mochawesome": "^3.1.1",
35-
"nativescript-dev-appium": "~5.2.0",
3624
"nativescript-dev-typescript": "~0.9.0",
3725
"nativescript-dev-webpack": "~0.22.0",
3826
"nativescript-vue-template-compiler": "~2.2.0",
3927
"node-sass": "~4.9.0",
4028
"vue-loader": "~15.4.2"
4129
},
4230
"scripts": {
43-
"build.plugin": "cd ../src && npm run build",
44-
"e2e": "tsc -p e2e && mocha --opts ./e2e/config/mocha.opts"
31+
"build.plugin": "cd ../src && npm run build"
4532
}
4633
}

demo/app/login-page.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
loaded="pageLoaded" class="page">
44
<StackLayout class="login-buttons">
55
<Facebook:LoginButton automationText="fbLogin" login="{{ onLogin }}"></Facebook:LoginButton>
6-
<Button tap="{{ login }}" text="Continue with Facebook (Custom)"></Button>
6+
<Button tap="{{ login }}" text="Continue with Facebook (Custom)" automationText="facebookCustom"></Button>
77
<Button tap="{{ getCurrentAccessToken }}" text="Get current access token"></Button>
88

99
<Facebook:ShareButton content="{{ linkContent }}"></Facebook:ShareButton>
1010
<Facebook:SendButton content="{{ genericContent }}"></Facebook:SendButton>
11-
<Button tap="{{ onShareDialog }}" text="Open Share dialog (link)" visibility="{{ canShowLinksShareDialog ? 'visible' : 'collapsed' }}" ></Button>
11+
<Button tap="{{ onShareDialog }}" automationText="Open Share dialog" text="Open Share dialog (link)" visibility="{{ canShowLinksShareDialog ? 'visible' : 'collapsed' }}" ></Button>
1212
<Button tap="{{ onShareDialogPhotos }}" text="Open Share dialog (photos)" visibility="{{ canShowPhotosShareDialog ? 'visible' : 'collapsed' }}"></Button>
1313
<Button tap="{{ onSendDialog }}" text="Open Message Share dialog" visibility="{{ canShowLinksMessageDialog ? 'visible' : 'collapsed' }}"></Button>
1414
<Button tap="{{ onSendGenericDialog }}" text="Share Message Generic Template" visibility="{{ canShowGenericMessageDialog ? 'visible' : 'collapsed' }}"></Button>

demo/e2e/config/appium.capabilities.json

Lines changed: 0 additions & 67 deletions
This file was deleted.

demo/e2e/config/mocha.opts

Lines changed: 0 additions & 5 deletions
This file was deleted.

demo/e2e/setup.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)