From d643c6d731f68ca244346b843293b94fdcfa2299 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Tue, 15 Jan 2019 17:37:58 +0200 Subject: [PATCH 01/13] Add vuejs builds and UI tests in travis.ci --- .travis.yml | 126 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 108 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc23a7e..cae4a76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,16 @@ branches: - master env: global: - - ANDROID_PACKAGE='facebook-debug.apk' - - ANDROID_PACKAGE_FOLDER=$TRAVIS_BUILD_DIR/demo/platforms/android/app/build/outputs/apk/debug - - ANDROID_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER/$ANDROID_PACKAGE?overwrite=true" - - IOS_PACKAGE='demo.zip' - - IOS_PACKAGE_FOLDER=$TRAVIS_BUILD_DIR/demo/platforms/ios/build/emulator - - IOS_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER/$IOS_PACKAGE?overwrite=true" + - ANDROID_PACKAGE_JS='facebook-debug-js.apk' + - ANDROID_PACKAGE_VUE='facebook-debug-vue.apk' + - ANDROID_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/platforms/android/app/build/outputs/apk/debug + - ANDROID_PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/platforms/android/app/build/outputs/apk/debug + - ANDROID_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER" + - IOS_PACKAGE_JS='demo-js.zip' + - IOS_PACKAGE_VUE='demo-vue.zip' + - IOS_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/platforms/ios/build/emulator + - IOS_PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/platforms/ios/build/emulator + - IOS_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER" matrix: include: @@ -21,62 +25,148 @@ matrix: os: osx env: - WebpackiOS="12.0" + - Type="VanillaJS" osx_image: xcode10.0 language: node_js node_js: "8" jdk: oraclejdk8 - before_script: pod repo update - script: cd src && npm run build.iosOnly && cd ../demo && npm i && tns build ios --env.uglify && cd ../demo-angular && npm i && tns build ios --env.uglify --env.aot + script: + - cd src && npm run build.iosOnly + - cd ../demo && npm i && tns build ios --env.uglify + - os: osx + env: + - WebpackiOS="12.0" + - Type="VueJS" + osx_image: xcode10.0 + language: node_js + node_js: "8" + jdk: oraclejdk8 + script: + - cd src && npm run build.iosOnly + - cd ../demo-vue && npm i && tns build ios --bundle --env.uglify + - os: osx + env: + - WebpackiOS="12.0" + - Type="Angular" + osx_image: xcode10.0 + language: node_js + node_js: "8" + jdk: oraclejdk8 + script: + - cd src && npm run build.iosOnly + - cd ../demo-ng && npm i && tns build ios --bundle --env.uglify --env.aot - language: android os: linux env: - WebpackAndroid="28" + - Type="VanillaJS" + jdk: oraclejdk8 + before_install: nvm install 8 + script: + - cd src && npm run build + - cd ../demo && npm i && tns build android --env.uglify --env.snapshot + - os: linux + env: + - WebpackAndroid="28" + - Type="VueJS" + jdk: oraclejdk8 + before_install: nvm install 8 + script: + - cd src && npm run build + - cd ../demo-vue && npm i && tns build android --bundle --env.uglify --env.snapshot + - "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" + - os: linux + env: + - WebpackAndroid="28" + - Type="Angular" jdk: oraclejdk8 before_install: nvm install 8 script: - - cd src && npm run build && cd ../demo && npm i && tns build android --env.uglify --env.snapshot - - cd ../demo-angular && npm i && tns build android --env.uglify --env.snapshot --env.aot + - cd src && npm run build + - cd ../demo-ng && npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot - language: android env: - BuildAndroid="28" + - Type="VanillaJS" os: linux jdk: oraclejdk8 before_install: nvm install 8.11.4 script: - - cd demo && npm run ci.android.build && cd ../demo-angular && npm run ci.android.build - - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE --data-binary @$ANDROID_PACKAGE_FOLDER/app-debug.apk" + - cd demo && npm run ci.android.build + - "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" + - env: + - BuildAndroid="28" + - Type="Angular" + os: linux + jdk: oraclejdk8 + before_install: nvm install 8.11.4 + script: + - cd ../demo-angular && npm run ci.android.build - os: osx env: - BuildiOS="12.0" - Xcode="10.0" + - Type="VanillaJS" + osx_image: xcode10.0 + language: node_js + node_js: "8" + jdk: oraclejdk8 + script: + - cd demo && npm run ci.ios.build + - cd $IOS_PACKAGE_FOLDER_JS && zip -r $IOS_PACKAGE_JS demo.app + - "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" + - env: + - BuildiOS="12.0" + - Xcode="10.0" + - Type="Angular" osx_image: xcode10.0 language: node_js node_js: "8" jdk: oraclejdk8 - before_script: pod repo update script: - - cd demo && npm run ci.ios.build && cd ../demo-angular && npm run ci.ios.build - - cd $IOS_PACKAGE_FOLDER && zip -r $IOS_PACKAGE demo.app - - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE --data-binary @$IOS_PACKAGE_FOLDER/$IOS_PACKAGE" + - cd ../demo-angular && npm run ci.ios.build - stage: "UI Tests" env: - Android="24" + - Type="VanillaJS" language: node_js os: linux node_js: "8" script: - npm i -g appium - cd demo && npm i - - travis_retry npm run e2e -- --runType android24 --sauceLab --reuseDevice --appPath $ANDROID_PACKAGE + - travis_retry npm run e2e -- --runType android24 --sauceLab --reuseDevice --appPath $ANDROID_PACKAGE_JS + - os: linux + env: + - Android="24" + - Type="VueJS" + language: node_js + os: linux + node_js: "8" + script: + - npm i -g appium + - cd demo-vue && npm i + - travis_retry npm run e2e -- --runType android24 --sauceLab --reuseDevice --appPath $ANDROID_PACKAGE_VUE - os: linux env: - iOS="12.0" + - Type="VanillaJS" language: node_js node_js: "8" script: - npm i -g appium - cd demo && npm i - - travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --reuseDevice --appPath $IOS_PACKAGE + - travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --reuseDevice --appPath $IOS_PACKAGE_JS + - os: linux + env: + - iOS="12.0" + - Type="VueJS" + language: node_js + node_js: "8" + script: + - npm i -g appium + - cd demo-vue && npm i + - travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --reuseDevice --appPath $IOS_PACKAGE_VUE android: components: From 78c660779988b59877b3e262e111c7a597e7bd59 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Tue, 15 Jan 2019 18:00:36 +0200 Subject: [PATCH 02/13] Add pod repo update on install --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cae4a76..6225c7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ matrix: jdk: oraclejdk8 script: - cd src && npm run build.iosOnly - - cd ../demo && npm i && tns build ios --env.uglify + - cd ../demo && npm i && tns build ios --bundle --env.uglify - os: osx env: - WebpackiOS="12.0" @@ -64,7 +64,8 @@ matrix: before_install: nvm install 8 script: - cd src && npm run build - - cd ../demo && npm i && tns build android --env.uglify --env.snapshot + - cd ../demo && npm i && tns build android --bundle --env.uglify + - "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" - os: linux env: - WebpackAndroid="28" @@ -93,7 +94,6 @@ matrix: before_install: nvm install 8.11.4 script: - cd demo && npm run ci.android.build - - "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" - env: - BuildAndroid="28" - Type="Angular" @@ -184,3 +184,4 @@ install: - npm install -g nativescript - tns usage-reporting disable - tns error-reporting disable + - pod repo update From a40938a77221bb4c27b91ae47918c8ea1dca5fbf Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Tue, 15 Jan 2019 18:02:16 +0200 Subject: [PATCH 03/13] Fix: pod-repo update only on ios before script --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6225c7f..4735b3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,7 @@ matrix: language: node_js node_js: "8" jdk: oraclejdk8 + before_script: pod repo update script: - cd src && npm run build.iosOnly - cd ../demo && npm i && tns build ios --bundle --env.uglify @@ -41,6 +42,7 @@ matrix: language: node_js node_js: "8" jdk: oraclejdk8 + before_script: pod repo update script: - cd src && npm run build.iosOnly - cd ../demo-vue && npm i && tns build ios --bundle --env.uglify @@ -52,6 +54,7 @@ matrix: language: node_js node_js: "8" jdk: oraclejdk8 + before_script: pod repo update script: - cd src && npm run build.iosOnly - cd ../demo-ng && npm i && tns build ios --bundle --env.uglify --env.aot @@ -111,6 +114,7 @@ matrix: language: node_js node_js: "8" jdk: oraclejdk8 + before_script: pod repo update script: - cd demo && npm run ci.ios.build - cd $IOS_PACKAGE_FOLDER_JS && zip -r $IOS_PACKAGE_JS demo.app @@ -123,6 +127,7 @@ matrix: language: node_js node_js: "8" jdk: oraclejdk8 + before_script: pod repo update script: - cd ../demo-angular && npm run ci.ios.build - stage: "UI Tests" @@ -184,4 +189,3 @@ install: - npm install -g nativescript - tns usage-reporting disable - tns error-reporting disable - - pod repo update From 27ef7029f86c4e95d22722f4825eec76430d1cb0 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Tue, 15 Jan 2019 18:37:59 +0200 Subject: [PATCH 04/13] Fix: demo-angular path --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4735b3b..ecdc930 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,7 @@ matrix: before_script: pod repo update script: - cd src && npm run build.iosOnly - - cd ../demo-ng && npm i && tns build ios --bundle --env.uglify --env.aot + - cd ../demo-angular && npm i && tns build ios --bundle --env.uglify --env.aot - language: android os: linux env: @@ -87,7 +87,7 @@ matrix: before_install: nvm install 8 script: - cd src && npm run build - - cd ../demo-ng && npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot + - cd ../demo-angular && npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot - language: android env: - BuildAndroid="28" @@ -104,7 +104,7 @@ matrix: jdk: oraclejdk8 before_install: nvm install 8.11.4 script: - - cd ../demo-angular && npm run ci.android.build + - cd demo-angular && npm run ci.android.build - os: osx env: - BuildiOS="12.0" From 9a939f1fc03434b7d427ab982169d24024f97ef2 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Wed, 16 Jan 2019 09:00:11 +0200 Subject: [PATCH 05/13] fix: add language android and osx to builds --- .travis.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ecdc930..0e9a2cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,8 @@ matrix: - cd src && npm run build - cd ../demo && npm i && tns build android --bundle --env.uglify - "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" - - os: linux + - language: android + os: linux env: - WebpackAndroid="28" - Type="VueJS" @@ -79,7 +80,8 @@ matrix: - cd src && npm run build - cd ../demo-vue && npm i && tns build android --bundle --env.uglify --env.snapshot - "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" - - os: linux + - language: android + os: linux env: - WebpackAndroid="28" - Type="Angular" @@ -97,7 +99,8 @@ matrix: before_install: nvm install 8.11.4 script: - cd demo && npm run ci.android.build - - env: + - language: android + env: - BuildAndroid="28" - Type="Angular" os: linux @@ -119,7 +122,8 @@ matrix: - cd demo && npm run ci.ios.build - cd $IOS_PACKAGE_FOLDER_JS && zip -r $IOS_PACKAGE_JS demo.app - "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" - - env: + - os: osx + env: - BuildiOS="12.0" - Xcode="10.0" - Type="Angular" From 51804668de2604bdef0d5934eca0486cbdd94e21 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Wed, 16 Jan 2019 09:48:44 +0200 Subject: [PATCH 06/13] fix: path to demo-angular, pack plugin on webpack build for angular --- .travis.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e9a2cb..4b0eb26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,9 @@ matrix: before_script: pod repo update script: - cd src && npm run build.iosOnly - - cd ../demo-angular && npm i && tns build ios --bundle --env.uglify --env.aot + - cd ../publish && sh pack.sh + - cd ../demo-angular && tns plugin add ../publish/package/*.tgz + - npm i && tns build ios --bundle --env.uglify --env.aot - language: android os: linux env: @@ -89,7 +91,9 @@ matrix: before_install: nvm install 8 script: - cd src && npm run build - - cd ../demo-angular && npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot + - cd ../publish && sh pack.sh + - cd ../demo-angular && tns plugin add ../publish/package/*.tgz + - npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot - language: android env: - BuildAndroid="28" @@ -133,7 +137,7 @@ matrix: jdk: oraclejdk8 before_script: pod repo update script: - - cd ../demo-angular && npm run ci.ios.build + - cd demo-angular && npm run ci.ios.build - stage: "UI Tests" env: - Android="24" From 79c4b03b9080f9b03b786065e95a6eb2da55f6e2 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Wed, 16 Jan 2019 10:25:58 +0200 Subject: [PATCH 07/13] fix: pack plugin on iOS --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4b0eb26..800d547 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,9 +56,8 @@ matrix: jdk: oraclejdk8 before_script: pod repo update script: - - cd src && npm run build.iosOnly - - cd ../publish && sh pack.sh - - cd ../demo-angular && tns plugin add ../publish/package/*.tgz + - cd src && npm run build.iosOnly && npm pack + - cd ../demo-angular && tns plugin add ../src/*.tgz - npm i && tns build ios --bundle --env.uglify --env.aot - language: android os: linux From e24684a537ad38d86d7756accb23a51b9bbe8a79 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Wed, 16 Jan 2019 17:55:37 +0200 Subject: [PATCH 08/13] Fix: version of iOS in capabilities --- demo-vue/e2e/config/appium.capabilities.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo-vue/e2e/config/appium.capabilities.json b/demo-vue/e2e/config/appium.capabilities.json index 1e04712..27a36ae 100644 --- a/demo-vue/e2e/config/appium.capabilities.json +++ b/demo-vue/e2e/config/appium.capabilities.json @@ -36,7 +36,7 @@ }, "sim12iPhoneX": { "platformName": "iOS", - "platformVersion": "12.1", + "platformVersion": "12.0", "deviceName": "iPhone X", "appium-version": "1.9.1", "app": "" From 2a7be03f5d7bedcd62c14c1e3a94c6b737eea0ea Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Thu, 17 Jan 2019 09:37:34 +0200 Subject: [PATCH 09/13] fix: update capabilities for vue demo tests --- demo-vue/e2e/config/appium.capabilities.json | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/demo-vue/e2e/config/appium.capabilities.json b/demo-vue/e2e/config/appium.capabilities.json index 27a36ae..bf19b37 100644 --- a/demo-vue/e2e/config/appium.capabilities.json +++ b/demo-vue/e2e/config/appium.capabilities.json @@ -18,7 +18,13 @@ "platformVersion": "7.0", "deviceName": "Android_GoogleAPI_Emulator", "appiumVersion": "1.9.1", - "noReset": true + "noReset": true, + "lt": 60000, + "newCommandTimeout": 720, + "appium-version": "1.9.1", + "fullReset": false, + "idleTimeout": 120, + "automationName": "Appium" }, "android25": { "platformName": "Android", @@ -39,7 +45,13 @@ "platformVersion": "12.0", "deviceName": "iPhone X", "appium-version": "1.9.1", - "app": "" + "app": "", + "noReset": true, + "fullReset": false, + "density": 3, + "offsetPixels": 87, + "idleTimeout": 120, + "automationName": "Appium" }, "sim103iPhone6": { "browserName": "", From f19c6f10f1f4c57f25da300350a85ecace722455 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Thu, 17 Jan 2019 12:08:14 +0200 Subject: [PATCH 10/13] fix: update demo zip package name for facebook --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 800d547..36bdecd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ env: - ANDROID_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/platforms/android/app/build/outputs/apk/debug - ANDROID_PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/platforms/android/app/build/outputs/apk/debug - ANDROID_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER" - - IOS_PACKAGE_JS='demo-js.zip' - - IOS_PACKAGE_VUE='demo-vue.zip' + - IOS_PACKAGE_JS='facebook-demo-js.zip' + - IOS_PACKAGE_VUE='facebook-demo-vue.zip' - IOS_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/platforms/ios/build/emulator - IOS_PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/platforms/ios/build/emulator - IOS_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER" From 04cae3ba7f0bffe432e0bca8fc097c061d08bd09 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Thu, 17 Jan 2019 16:15:43 +0200 Subject: [PATCH 11/13] fix: travis.yml for ios app --- .travis.yml | 10 ++++++---- demo-vue/e2e/test.e2e.ts | 23 +++++++++++++---------- demo-vue/package.json | 6 +++--- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 36bdecd..84f7ef8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,6 +46,8 @@ matrix: script: - cd src && npm run build.iosOnly - cd ../demo-vue && npm i && tns build ios --bundle --env.uglify + - cd $IOS_PACKAGE_FOLDER_VUE && zip -r $IOS_PACKAGE_VUE demovue.app + - "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" - os: osx env: - WebpackiOS="12.0" @@ -147,7 +149,7 @@ matrix: script: - npm i -g appium - cd demo && npm i - - travis_retry npm run e2e -- --runType android24 --sauceLab --reuseDevice --appPath $ANDROID_PACKAGE_JS + - travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_JS - os: linux env: - Android="24" @@ -158,7 +160,7 @@ matrix: script: - npm i -g appium - cd demo-vue && npm i - - travis_retry npm run e2e -- --runType android24 --sauceLab --reuseDevice --appPath $ANDROID_PACKAGE_VUE + - travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_VUE - os: linux env: - iOS="12.0" @@ -168,7 +170,7 @@ matrix: script: - npm i -g appium - cd demo && npm i - - travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --reuseDevice --appPath $IOS_PACKAGE_JS + - travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_JS - os: linux env: - iOS="12.0" @@ -178,7 +180,7 @@ matrix: script: - npm i -g appium - cd demo-vue && npm i - - travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --reuseDevice --appPath $IOS_PACKAGE_VUE + - travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_VUE android: components: diff --git a/demo-vue/e2e/test.e2e.ts b/demo-vue/e2e/test.e2e.ts index 215a519..3619afd 100644 --- a/demo-vue/e2e/test.e2e.ts +++ b/demo-vue/e2e/test.e2e.ts @@ -35,7 +35,7 @@ describe("Facebook tests", async function () { it("should log in via custom button", async function () { if (isAndroid) { - var userNameLabelElement = "[@text='Nativescript User']"; + var userNameLabelElement = "Nativescript User"; } else { var userNameLabelElement = "[@name='Nativescript User']"; } @@ -44,12 +44,14 @@ describe("Facebook tests", async function () { await facebookButton.click(); if (isAndroid) { - const allFields = await driver.findElementsByClassName(driver.locators.getElementByName("textfield")); + await driver.wait(1000); + const allFields = await driver.findElementsByClassName("android.widget.EditText"); + // driver.locators.getElementByName("android.widget.EditText") const wd = driver.wd(); const action = new wd.TouchAction(driver.driver); action - .press({ x: 52, y: 499 }) - .moveTo({ x: -2, y: -294 }) + .press({ x: 380, y: 720 }) + .moveTo({ x: 380, y: 410 }) .release(); await action.perform(); await driver.wait(1000); @@ -73,7 +75,7 @@ describe("Facebook tests", async function () { if (isAndroid) { const logInButton = await driver.findElementByClassName(driver.locators.button); await logInButton.click(); - const continueButton = await driver.findElementByText("Continue"); + const continueButton = await driver.findElementByAccessibilityId("Continue"); await continueButton.click(); } else { const logInButton = await driver.findElementByText("Log In"); @@ -81,11 +83,9 @@ describe("Facebook tests", async function () { const continueButton = await driver.findElementByText("Continue"); await continueButton.click(); } - const userNameLabel = await driver.findElementByXPath( - "//" + driver.locators.getElementByName("label") + userNameLabelElement - ); - const userName = await userNameLabel.text(); - expect(userName).to.equal(USER_NAME, "Not logged with the same user"); + await driver.wait(1000); + const userNameLabel = await driver.findElementByText("Nativescript User", SearchOptions.contains); + expect(userNameLabel).to.exist; }); it("should log out via custom button", async function () { @@ -102,6 +102,9 @@ describe("Facebook tests", async function () { const allFields = await driver.findElementsByClassName(driver.locators.getElementByName("textfield")); await allFields[1].sendKeys(PASSWORD); await allFields[0].sendKeys(USERNAME); + try { + await driver.driver.hideDeviceKeyboard("Done"); + } catch (error) { } const logInButton = await driver.findElementByClassName(driver.locators.button); await logInButton.click(); } else { diff --git a/demo-vue/package.json b/demo-vue/package.json index 74e67ab..a7265fa 100644 --- a/demo-vue/package.json +++ b/demo-vue/package.json @@ -18,17 +18,17 @@ "tns-core-modules": "~5.1.0" }, "devDependencies": { + "@babel/core": "~7.1.0", + "@babel/preset-env": "~7.1.0", "@types/chai": "^4.1.3", "@types/mocha": "^5.2.0", "@types/node": "^10.1.2", - "@babel/core": "~7.1.0", - "@babel/preset-env": "~7.1.0", + "babel-loader": "~8.0.0", "chai": "~4.1.2", "chai-as-promised": "~7.1.1", "karma": "^2.0.2", "karma-nativescript-launcher": "^0.4.0", "mocha": "~5.2.0", - "babel-loader": "~8.0.0", "nativescript-dev-appium": "^4.0.9", "nativescript-dev-typescript": "~0.7.0", "nativescript-dev-webpack": "~0.19.0", From 4984a817588532e26f8b1c6d607b275d27dd4ea6 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Thu, 17 Jan 2019 17:21:55 +0200 Subject: [PATCH 12/13] fix: capabilities name for android device --- .travis.yml | 4 ++-- demo-vue/e2e/config/appium.capabilities.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84f7ef8..17c7453 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,7 @@ matrix: before_install: nvm install 8 script: - cd src && npm run build - - cd ../demo && npm i && tns build android --bundle --env.uglify + - cd ../demo && npm i && tns build android --bundle --env.uglify --env.snapshot - "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" - language: android os: linux @@ -81,7 +81,7 @@ matrix: before_install: nvm install 8 script: - cd src && npm run build - - cd ../demo-vue && npm i && tns build android --bundle --env.uglify --env.snapshot + - cd ../demo-vue && npm i && tns build android --bundle --env.uglify - "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" - language: android os: linux diff --git a/demo-vue/e2e/config/appium.capabilities.json b/demo-vue/e2e/config/appium.capabilities.json index bf19b37..5129fcb 100644 --- a/demo-vue/e2e/config/appium.capabilities.json +++ b/demo-vue/e2e/config/appium.capabilities.json @@ -16,7 +16,7 @@ "android24": { "platformName": "Android", "platformVersion": "7.0", - "deviceName": "Android_GoogleAPI_Emulator", + "deviceName": "Android GoogleAPI Emulator", "appiumVersion": "1.9.1", "noReset": true, "lt": 60000, From fa114d03b9fea3b3a56c26eff263e898b8325d8d Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Fri, 18 Jan 2019 13:43:10 +0200 Subject: [PATCH 13/13] Fix: locator for continue button --- demo-vue/e2e/test.e2e.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/demo-vue/e2e/test.e2e.ts b/demo-vue/e2e/test.e2e.ts index 3619afd..9644b24 100644 --- a/demo-vue/e2e/test.e2e.ts +++ b/demo-vue/e2e/test.e2e.ts @@ -46,7 +46,6 @@ describe("Facebook tests", async function () { if (isAndroid) { await driver.wait(1000); const allFields = await driver.findElementsByClassName("android.widget.EditText"); - // driver.locators.getElementByName("android.widget.EditText") const wd = driver.wd(); const action = new wd.TouchAction(driver.driver); action @@ -75,14 +74,13 @@ describe("Facebook tests", async function () { if (isAndroid) { const logInButton = await driver.findElementByClassName(driver.locators.button); await logInButton.click(); - const continueButton = await driver.findElementByAccessibilityId("Continue"); - await continueButton.click(); + await driver.wait(500); } else { const logInButton = await driver.findElementByText("Log In"); await logInButton.click(); - const continueButton = await driver.findElementByText("Continue"); - await continueButton.click(); } + const continueButton = await driver.findElementByText("Continue", SearchOptions.exact); + await continueButton.click(); await driver.wait(1000); const userNameLabel = await driver.findElementByText("Nativescript User", SearchOptions.contains); expect(userNameLabel).to.exist;