Skip to content

Add demo-vue tests #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 129 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ branches:
- master
env:
global:
- ANDROID_PACKAGE='camera-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='camera.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='camera-debug-js.apk'
- ANDROID_PACKAGE_VUE='camera-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='camera-js.zip'
- IOS_PACKAGE_VUE='camera-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:
Expand All @@ -21,58 +25,157 @@ matrix:
os: osx
env:
- WebPackiOS="12.0"
- Type="VanillaJS"
osx_image: xcode10.0
language: node_js
node_js: "8"
jdk: oraclejdk8
script: cd demo && npm run build.plugin && npm i && tns build ios --env.uglify && cd ../demo-angular && npm i && tns build ios --env.uglify --env.aot
script:
- cd demo && npm run build.plugin
- 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 && npm pack
- cd ../demo-angular && tns plugin add ../src/*.tgz
- npm i && tns build ios --bundle --env.uglify --env.aot
- 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
- 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"
- language: android
os: linux
env:
- WebPackAndroid="28"
- WebpackAndroid="28"
- Type="VanillaJS"
jdk: oraclejdk8
before_install: nvm install 8
script:
- cd src && npm run build
- 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
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
- "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
env:
- WebpackAndroid="28"
- Type="Angular"
jdk: oraclejdk8
before_install: nvm install 8
script:
- cd src && npm run build
- 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"
- Type="VanillaJS"
os: linux
jdk: oraclejdk8
before_install: nvm install 8.11.4
script: cd demo && npm run build.plugin && npm i && tns build android --env.uglify --env.snapshot && cd ../demo-angular && npm i && tns build android --env.uglify --env.snapshot --env.aot
- env:
script:
- cd demo && npm run ci.android.build
- language: android
env:
- BuildAndroid="28"
language: android
- Type="Angular"
os: linux
jdk: oraclejdk8
before_install: nvm install 8.11.4
script:
- cd src && npm i && npm run tsc && cd ../demo && tns build android && cd ../demo-angular && tns build android
- "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-angular && npm run ci.android.build
- os: osx
env:
env:
- BuildiOS="12.0"
- Xcode="10.0"
- Type="VanillaJS"
osx_image: xcode10.0
language: node_js
language: node_js
node_js: "8"
jdk: oraclejdk8
script:
- cd src && npm i && npm run tsc && cd ../demo && tns build ios && cd ../demo-angular && tns build ios
- 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"
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"
- os: osx
env:
- BuildiOS="12.0"
- Xcode="10.0"
- Type="Angular"
osx_image: xcode10.0
language: node_js
node_js: "8"
jdk: oraclejdk8
script:
- cd demo-angular && npm run ci.ios.build
- stage: "UI Tests"
env:
- Android="23"
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 android23 --sauceLab --reuseDevice --appPath $ANDROID_PACKAGE
- travis_wait travis_retry npm run e2e -- --runType android23 --sauceLab --appPath $ANDROID_PACKAGE_JS
- os: linux
env:
- iOS="10"
language: node_js
env:
- Android="24"
- Type="VueJS"
language: node_js
os: linux
node_js: "8"
script:
- npm i -g appium
- cd demo-vue && npm i
- travis_wait travis_retry npm run e2e -- --runType android23 --sauceLab --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 sim.iPhone8.iOS11.2 --sauceLab --reuseDevice --appPath $IOS_PACKAGE
- travis_wait travis_retry npm run e2e -- --runType sim.iPhoneX.iOS12 --sauceLab --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 sim.iPhoneX.iOS12 --sauceLab --appPath $IOS_PACKAGE_VUE

android:
components:
Expand Down
4 changes: 3 additions & 1 deletion demo-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
},
"scripts": {
"build.plugin": "cd ../src && npm run build",
"ci.tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**'"
"ci.tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**'",
"ci.android.build": "cd ../src && npm run build && cd ../demo-angular && tns build android",
"ci.ios.build": "cd ../src && npm run build && cd ../demo-angular && tns build ios"
},
"dependencies": {
"@angular/animations": "~7.1.0",
Expand Down
144 changes: 144 additions & 0 deletions demo-vue/e2e/config/appium.capabilities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"android19": {
"platformName": "Android",
"platformVersion": "4.4",
"deviceName": "Emulator-Api19-Default",
"avd": "Emulator-Api19-Default",
"lt": 60000,
"appActivity": "com.tns.NativeScriptActivity",
"newCommandTimeout": 720,
"noReset": true,
"fullReset": false,
"app": ""
},
"android21": {
"platformName": "Android",
"platformVersion": "5.0",
"deviceName": "Emulator-Api21-Default",
"avd": "Emulator-Api21-Default",
"lt": 60000,
"appActivity": "com.tns.NativeScriptActivity",
"newCommandTimeout": 720,
"noReset": true,
"fullReset": false,
"app": ""
},
"android23.local": {
"platformName": "Android",
"platformVersion": "6.0",
"deviceName": "Emulator_Api23_Default",
"avd": "Emulator_Api23_Default",
"noReset": true
},
"android23": {
"platformName": "Android",
"platformVersion": "6.0",
"deviceName": "Android Emulator",
"appium-version": "1.7.1",
"noReset": true
},
"android24": {
"platformName": "Android",
"platformVersion": "7.0",
"deviceName": "Android GoogleAPI Emulator",
"lt": 60000,
"appActivity": "com.tns.NativeScriptActivity",
"newCommandTimeout": 720,
"noReset": true,
"fullReset": false,
"app": ""
},
"android24.sauce": {
"platformName": "Android",
"platformVersion": "7.0",
"deviceName": "Android GoogleAPI Emulator",
"lt": 60000,
"newCommandTimeout": 720,
"appiumVersion": "1.9.1",
"noReset": true,
"fullReset": false,
"app": ""
},
"android25": {
"platformName": "Android",
"platformVersion": "7.1",
"deviceName": "Emulator-Api25-Google",
"avd": "Emulator-Api25-Google",
"lt": 60000,
"appActivity": "com.tns.NativeScriptActivity",
"newCommandTimeout": 720,
"noReset": true,
"fullReset": false,
"app": ""
},
"android26": {
"platformName": "Android",
"platformVersion": "8.0",
"deviceName": "Emulator-Api26-Google",
"avd": "Emulator-Api26-Google",
"noReset": true,
"fullReset": false,
"app": ""
},
"sim.iPhone7.iOS100": {
"platformName": "iOS",
"platformVersion": "10.0",
"deviceName": "iPhone 7 100",
"noReset": true,
"fullReset": false,
"app": ""
},
"sim103iPhone6": {
"browserName": "",
"appiumVersion": "1.7.1",
"platformName": "iOS",
"platformVersion": "10.3",
"deviceName": "iPhone 6",
"app": ""
},
"sim.iPhone8.iOS110": {
"platformName": "iOS",
"platformVersion": "11.0",
"deviceName": "iPhone 8 110",
"noReset": true,
"fullReset": false,
"app": ""
},
"sim.iPhoneX.iOS110": {
"platformName": "iOS",
"platformVersion": "11.0",
"deviceName": "iPhone X",
"noReset": true,
"fullReset": false,
"app": ""
},
"sim.iPhoneX.iOS12": {
"platformName": "iOS",
"platformVersion": "12.0",
"deviceName": "iPhone X",
"noReset": true,
"fullReset": false,
"app": "",
"density":3,
"offsetPixels":87
},
"sim.iPhoneX.iOS12.1": {
"platformName": "iOS",
"platformVersion": "12.1",
"deviceName": "iPhone X",
"noReset": true,
"fullReset": false,
"app": "",
"density":3,
"offsetPixels":87
},
"sim.iPhone8.iOS11.2": {
"platformName": "iOS",
"platformVersion": "11.2",
"deviceName": "iPhone 8",
"noReset": true,
"fullReset": false,
"appiumVersion": "1.7.1",
"app": ""
}
}
4 changes: 4 additions & 0 deletions demo-vue/e2e/config/mocha.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--timeout 800000
--recursive e2e
--reporter mocha-multi
--reporter-options spec=-,mocha-junit-reporter=test-results.xml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions demo-vue/e2e/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { startServer, stopServer } from "nativescript-dev-appium";

before("start server", async () => {
await startServer();
});

after("stop server", async () => {
await stopServer();
});
Loading