Skip to content
Merged
136 changes: 120 additions & 16 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='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='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"

matrix:
include:
Expand All @@ -21,62 +25,162 @@ 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 --bundle --env.uglify
- os: osx
env:
- WebpackiOS="12.0"
- Type="VueJS"
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-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"
- Type="Angular"
osx_image: xcode10.0
language: node_js
node_js: "8"
jdk: oraclejdk8
before_script: pod repo update
script:
- 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
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 --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 ../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 ../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 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
- language: android
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
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
- "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
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_wait travis_retry npm run e2e -- --runType android24 --sauceLab --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_wait travis_retry npm run e2e -- --runType android24 --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 sim12iPhoneX --sauceLab --reuseDevice --appPath $IOS_PACKAGE
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --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 sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_VUE

android:
components:
Expand Down
20 changes: 16 additions & 4 deletions demo-vue/e2e/config/appium.capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@
"android24": {
"platformName": "Android",
"platformVersion": "7.0",
"deviceName": "Android_GoogleAPI_Emulator",
"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",
Expand All @@ -36,10 +42,16 @@
},
"sim12iPhoneX": {
"platformName": "iOS",
"platformVersion": "12.1",
"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": "",
Expand Down
27 changes: 14 additions & 13 deletions demo-vue/e2e/test.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']";
}
Expand All @@ -44,12 +44,13 @@ 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");
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);
Expand All @@ -73,19 +74,16 @@ describe("Facebook tests", async function () {
if (isAndroid) {
const logInButton = await driver.findElementByClassName(driver.locators.button);
await logInButton.click();
const continueButton = await driver.findElementByText("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 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");
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;
});

it("should log out via custom button", async function () {
Expand All @@ -102,6 +100,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 {
Expand Down
6 changes: 3 additions & 3 deletions demo-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down