Skip to content

Commit 52599d8

Browse files
authored
Merge pull request #6 from nativescript-vue/ns-vue-v2
Upgraded Appium, NS, and NS-vue versions, fixed bugs, completed docs
2 parents c4c461d + 74cd35e commit 52599d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+76
-18
lines changed

README.md

Lines changed: 41 additions & 2 deletions

app/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ new Vue({
110110
},
111111

112112
template: `
113+
<Frame>
113114
<Page>
114115
<ActionBar title="Home"></ActionBar>
115116
<WrapLayout class="m-5 home-list">
116117
<Button :text="el.name" v-for="el in elements" @tap="showElement(el)" />
117118
</WrapLayout>
118119
</Page>
120+
</Frame>
119121
`,
120122
}).$start();

appium.capabilities.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
{
22
"android23": {
3+
"automationName": "appium",
34
"platformName": "Android",
45
"platformVersion": "6.0",
56
"deviceName": "Android Emulator",
67
"noReset": false,
8+
"avd": "Nexus_5X_API_27",
79
"appPackage": "org.nativescript.nativescriptvueuitests",
810
"appActivity": "com.tns.NativeScriptActivity"
911
},
1012
"ios-simulator103iPhone6": {
13+
"automationName": "appium",
1114
"platformName": "iOS",
12-
"platformVersion": "10.3",
15+
"platformVersion": "11.4",
1316
"deviceName": "iPhone Simulator",
1417
"bundleId": "org.nativescript.nativescriptvueuitests",
1518
"app": ""
1619
}
17-
}
20+
}

generate-screenshots.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const argv = require('yargs').argv;
22
const AppiumDriver = require('nativescript-dev-appium').AppiumDriver;
3+
const DeviceManager = require('nativescript-dev-appium').DeviceManager;
34
const fs = require('fs');
45

56
const components = [
@@ -39,13 +40,23 @@ const makeDir = (path) => {
3940
makeDir('screenshots');
4041
makeDir(`screenshots/${argv.runType}`);
4142

42-
AppiumDriver.createAppiumDriver(4723, {
43-
isSauceLab: argv.sauceLab || false,
44-
runType: argv.runType,
45-
appPath: argv.appPath, //'nativescriptvueuitests-debug.apk',
46-
appiumCaps: require('./appium.capabilities.json')[argv.runType],
47-
verbose: argv.verbose || false,
48-
})
43+
const appiumCaps = require('./appium.capabilities.json')[argv.runType];
44+
let args = {
45+
isSauceLab: argv.sauceLab || false,
46+
runType: argv.runType,
47+
appPath: argv.appPath, //'nativescriptvueuitests-debug.apk',
48+
appiumCaps: appiumCaps,
49+
verbose: argv.verbose || false,
50+
}
51+
// Hack to fix a `Cannot read property 'token' of undefined` error
52+
// See https://github.com/NativeScript/nativescript-dev-appium/issues/142
53+
if (args.isAndroid) {
54+
args.device = DeviceManager.getDefaultDevice(args, appiumCaps.avd);
55+
} else {
56+
args.device = DeviceManager.getDefaultDevice(args);
57+
}
58+
59+
AppiumDriver.createAppiumDriver(4723, args)
4960
.then(driver => run(driver))
5061
.then(() => console.log('Buh-Bye...'))
5162
.catch((err) => console.log(err));

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
"nativescript": {
77
"id": "org.nativescript.nativescriptvueuitests",
88
"tns-ios": {
9-
"version": "3.4.1"
9+
"version": "4.1.0"
1010
},
1111
"tns-android": {
12-
"version": "3.4.1"
12+
"version": "4.1.3"
1313
}
1414
},
1515
"dependencies": {
16-
"appium": "^1.7.1",
17-
"nativescript-dev-appium": "^3.1.0-2017-10-6-1",
18-
"nativescript-vue": "^1.0.0",
19-
"tns-core-modules": "~3.4.0",
16+
"appium": "^1.8.1",
17+
"nativescript-dev-appium": "^4.0.0",
18+
"nativescript-vue": "^2.0.0-alpha.1",
19+
"tns-core-modules": "^4.1.1",
2020
"yargs": "^9.0.1"
2121
},
2222
"scripts": {
@@ -34,6 +34,9 @@
3434
"babel-traverse": "6.26.0",
3535
"babel-types": "6.26.0",
3636
"babylon": "6.18.0",
37-
"lazy": "1.0.11"
37+
"lazy": "1.0.11",
38+
"@types/chai": "^4.0.2",
39+
"@types/mocha": "^2.2.41",
40+
"@types/node": "^7.0.5"
3841
}
3942
}
36.7 KB
36.7 KB

screenshots/android23/Button.png

36.5 KB
46.8 KB

screenshots/android23/HtmlView.png

36.3 KB

0 commit comments

Comments
 (0)