Skip to content

Upgraded Appium, NS, and NS-vue versions, fixed bugs, completed docs #6

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 10 commits into from
Apr 17, 2019
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,59 @@ This project uses Appium to test Vue UI components, and also serves as a source
component screenshots at [nativescript-vue.org](https://nativescript-vue.org/).

## System requirements

* Node 7.6 or higher (for async function support).
* The [Appium](http://appium.io/) client. Just download and install the latest [from GitHub](https://github.com/appium/appium-desktop/releases/latest).
* The [Appium](http://appium.io/) client. Just download and install the latest [from GitHub](https://github.com/appium/appium-desktop/releases/latest) or execute the following command:

```bash
npm install -g appium
```

### iOS requirements

* Carthage:

```bash
brew install carthage
````

## Running the tests locally
Start Appium and press 'Start the server', or you'll receive an error `127.0.0.1:4723` can't be reached.

Start Appium, which is

* Using the desktop app, press 'Start the server'
* Using the NPM package, execute `appium` on a terminal

Otherwise you'll receive an error `127.0.0.1:4723` can't be reached.

### Android

Edit the `appium.capabilities.json` config file, in the `android23` section, with your device/emulators parameters, probably only the `avd` or `deviceName` parameters would be enough.

Start the tests:

```bash
npm run android.build
adb install ./platforms/android/app/build/outputs/apk/debug/app-debug.apk
npm run android.screenshots
```

### iOS

Edit the `appium.capabilities.json` config file, in the `ios-simulator103iPhone6` section, with your device/emulators parameters.

Build the iOS app

```bash
npm run ios.build
```

Start `XCode` and open the `platforms/ios/nativescriptvueuitests.xcodeproj` file.

Run the app on the emulator. This is needed in order to have the app installed.

Run the tests:

```bash
npm run ios.screenshots
```
2 changes: 2 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ new Vue({
},

template: `
<Frame>
<Page>
<ActionBar title="Home"></ActionBar>
<WrapLayout class="m-5 home-list">
<Button :text="el.name" v-for="el in elements" @tap="showElement(el)" />
</WrapLayout>
</Page>
</Frame>
`,
}).$start();
7 changes: 5 additions & 2 deletions appium.capabilities.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"android23": {
"automationName": "appium",
"platformName": "Android",
"platformVersion": "6.0",
"deviceName": "Android Emulator",
"noReset": false,
"avd": "Nexus_5X_API_27",
"appPackage": "org.nativescript.nativescriptvueuitests",
"appActivity": "com.tns.NativeScriptActivity"
},
"ios-simulator103iPhone6": {
"automationName": "appium",
"platformName": "iOS",
"platformVersion": "10.3",
"platformVersion": "11.4",
"deviceName": "iPhone Simulator",
"bundleId": "org.nativescript.nativescriptvueuitests",
"app": ""
}
}
}
25 changes: 18 additions & 7 deletions generate-screenshots.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const argv = require('yargs').argv;
const AppiumDriver = require('nativescript-dev-appium').AppiumDriver;
const DeviceManager = require('nativescript-dev-appium').DeviceManager;
const fs = require('fs');

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

AppiumDriver.createAppiumDriver(4723, {
isSauceLab: argv.sauceLab || false,
runType: argv.runType,
appPath: argv.appPath, //'nativescriptvueuitests-debug.apk',
appiumCaps: require('./appium.capabilities.json')[argv.runType],
verbose: argv.verbose || false,
})
const appiumCaps = require('./appium.capabilities.json')[argv.runType];
let args = {
isSauceLab: argv.sauceLab || false,
runType: argv.runType,
appPath: argv.appPath, //'nativescriptvueuitests-debug.apk',
appiumCaps: appiumCaps,
verbose: argv.verbose || false,
}
// Hack to fix a `Cannot read property 'token' of undefined` error
// See https://github.com/NativeScript/nativescript-dev-appium/issues/142
if (args.isAndroid) {
args.device = DeviceManager.getDefaultDevice(args, appiumCaps.avd);
} else {
args.device = DeviceManager.getDefaultDevice(args);
}

AppiumDriver.createAppiumDriver(4723, args)
.then(driver => run(driver))
.then(() => console.log('Buh-Bye...'))
.catch((err) => console.log(err));
Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"nativescript": {
"id": "org.nativescript.nativescriptvueuitests",
"tns-ios": {
"version": "3.4.1"
"version": "4.1.0"
},
"tns-android": {
"version": "3.4.1"
"version": "4.1.3"
}
},
"dependencies": {
"appium": "^1.7.1",
"nativescript-dev-appium": "^3.1.0-2017-10-6-1",
"nativescript-vue": "^1.0.0",
"tns-core-modules": "~3.4.0",
"appium": "^1.8.1",
"nativescript-dev-appium": "^4.0.0",
"nativescript-vue": "^2.0.0-alpha.1",
"tns-core-modules": "^4.1.1",
"yargs": "^9.0.1"
},
"scripts": {
Expand All @@ -34,6 +34,9 @@
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"lazy": "1.0.11"
"lazy": "1.0.11",
"@types/chai": "^4.0.2",
"@types/mocha": "^2.2.41",
"@types/node": "^7.0.5"
}
}
Binary file modified screenshots/android23/ActionDialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/ActivityIndicator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/Button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/DatePicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/HtmlView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/Label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/ListPicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/ListView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/Progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/ScrollView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/SearchBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/SegmentedBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/Slider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/Switch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/TabView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/TextField.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/TextView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/TimePicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/android23/WebView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/ios-simulator103iPhone6/ActionDialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/ios-simulator103iPhone6/ActivityIndicator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/ios-simulator103iPhone6/Button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/ios-simulator103iPhone6/DatePicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/ios-simulator103iPhone6/HtmlView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/ios-simulator103iPhone6/Image.png
Binary file modified screenshots/ios-simulator103iPhone6/Label.png
Binary file modified screenshots/ios-simulator103iPhone6/ListPicker.png
Binary file modified screenshots/ios-simulator103iPhone6/ListView.png
Binary file modified screenshots/ios-simulator103iPhone6/Progress.png
Binary file modified screenshots/ios-simulator103iPhone6/ScrollView.png
Binary file modified screenshots/ios-simulator103iPhone6/SearchBar.png
Binary file modified screenshots/ios-simulator103iPhone6/SegmentedBar.png
Binary file modified screenshots/ios-simulator103iPhone6/Slider.png
Binary file modified screenshots/ios-simulator103iPhone6/Switch.png
Binary file modified screenshots/ios-simulator103iPhone6/TabView.png
Binary file modified screenshots/ios-simulator103iPhone6/TextField.png
Binary file modified screenshots/ios-simulator103iPhone6/TextView.png
Binary file modified screenshots/ios-simulator103iPhone6/TimePicker.png
Binary file modified screenshots/ios-simulator103iPhone6/WebView.png