Skip to content

Commit 8ede903

Browse files
release: cut the 5.0.0 release (#194)
1 parent 5ca986a commit 8ede903

File tree

7 files changed

+58
-12
lines changed

7 files changed

+58
-12
lines changed

CHANGELOG.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
<a name="5.0.0"></a>
2+
# [5.0.0]() (2019-01-29)
3+
4+
### Bug Fixes
5+
* isDisplayed already checks whether actual coordinates of an element are in visible viewport of display
6+
* resolve app name when starting of appium server is skipped
7+
* **locators** android webView locator is renamed to android.webkit.WebView
8+
9+
### Features
10+
* run tests without providing appium capabilities config/ --runType.
11+
This option is only available for local runs which means that
12+
device should already be started and the app should already be installed.
13+
* device properties can be passed as regex expression (this is not available in sauceLab)
14+
* isSelected method - works only if the element has tag select
15+
* --runType parameter is already case insensitive e.g. sim.iOS == sim.ios
16+
* waitForElement method = searched for element by automation text and wait time in milliseconds.
17+
* include support for jasmine.
18+
* include support for javascript, typescript, angular, vue and angular(shared project)
19+
20+
### BREAKING CHANGES
21+
22+
* --reuseDevice options is removed. This is not concerning test which uses sauceLabs
23+
24+
Before:
25+
```
26+
$ npm run e2e -- --runType android23 --reuseDevice
27+
```
28+
After there are a few options in order to preserve device alive:
29+
30+
1. If you are developing your application with `tns run android/ ios`
31+
32+
```
33+
$ npm run e2e android or ios
34+
```
35+
2. If you are running on CI, change appium options as
36+
--fullReset: false -> this will keep device alive
37+
--noReset: false -> this will install app on device
38+
39+
40+
141
<a name="4.0.6"></a>
242
# [4.0.6]() (2018-08-08)
343
### Bug Fixes
@@ -62,10 +102,10 @@ Default automation was 'Appium' for all api levels.
62102
```
63103
After:
64104
```
65-
For all api levels higer or equal than api23 (including) default automator name is 'UiAutomator2'
105+
For all api levels higher or equal than api23 (including) default automator name is 'UiAutomator2'
66106
For all api levels lower than api23 default automator is still 'Appium'
67107
```
68-
* rename DeviceController to DeviceManager - In general this should not affect any user except those that are using DeviceManager explicity
108+
* rename DeviceController to DeviceManager - In general this should not affect any user except those that are using DeviceManager explicitly
69109
* bump version of mocha to ~5.1.0 which requires flag --exit to be set in mocha config file when the tests are run ot Travis
70110
```
71111

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ or
147147
$ npm run e2e -- --runType sim.iPhone8.iOS110
148148
```
149149

150+
or for local runs during development
151+
```
152+
$ npm run e2e android
153+
$ npm run e2e ios
154+
$ npm run e2e -- --device.name=/iPhone X/ --device.apiLevel=/12.1/
155+
```
156+
150157
Generated tests are standard [Mocha](http://mochajs.org) tests.
151158

152159
## Blogs
@@ -258,7 +265,6 @@ As you can see, the `app` property can be left an empty string which will force
258265
|---|---|---|
259266
|runType| Select the capabilities from your config file `appium.capabilities.json`| Consider using `android`, `device`, `sim` strings as part of your `runType` option if you haven't provided `app` capability. Thus, the runner will look for app package in the right location for the current run. <br/> e.g. --runType ios-device10iPhone6|
260267
|appPath| Provide location of the app package to be tested. This will overwrite all provided capabilities for app| Possible values are:<br/> - app build package name (in case `--sauceLab` option is set it will prepend `sauce-storage:` in front of the app name so app has to be [uploaded to Sauce Labs](https://wiki.saucelabs.com/display/DOCS/Uploading+Mobile+Applications+to+Sauce+Storage+for+Testing) before execution starts)<br/> - path e.g. `platforms/android/build/outputs/apk/demo.apk`.<br/> Example: --appPath demo-debug.apk|
261-
| reuseDevice | Reuse the device specified in the `runType` capabilities. If the emulator/simulator is not running, it will launch, execute tests and remain running. The next execution of `npm run e2e` with the `reuseDevice` option will attach to the already running emulator/simulator, execute tests and keep it running. | e.g. --reuseDevice |
262268
| devMode | `devMode` capabilities. Skipping application instalation and will automatically reuse device. | e.g. --devMode |
263269
|sauceLab| Enable tests execution in [Sauce Labs](https://saucelabs.com/). As a prerequisite you will have to define `SAUCE_USER` and `SAUCE_KEY` as [environment variable](https://wiki.saucelabs.com/display/DOCS/Best+Practice%3A+Use+Environment+Variables+for+Authentication+Credentials)| e.g. --sauceLab|
264270
|appiumCapsLocation| Change the location where `appium.capabilities.json` config file can be. It should be relative to the root directory | e.g. --appiumCapsLocation /e2e-tests|

lib/appium-driver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export class AppiumDriver {
438438
* @param xOffset
439439
*/
440440
public async scroll(direction: Direction, y: number, x: number, yOffset: number, xOffset: number = 0) {
441-
scroll(this._wd, this._driver, direction, this._webio.isIOS, y, x, yOffset, xOffset, this._args.verbose);
441+
await scroll(this._wd, this._driver, direction, this._webio.isIOS, y, x, yOffset, xOffset, this._args.verbose);
442442
}
443443

444444
/**

lib/device-manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class DeviceManager implements IDeviceManager {
133133
}
134134
}
135135

136-
public static async getDevices(query: IDevice) {
136+
public static async getDevices(query: IDevice): Promise<IDevice[]> {
137137
return await DeviceController.getDevices(query);
138138
}
139139

@@ -160,11 +160,11 @@ export class DeviceManager implements IDeviceManager {
160160
}
161161
}
162162

163-
public static async getInstalledApps(device: IDevice) {
163+
public static async getInstalledApps(device: IDevice): Promise<string[]> {
164164
return await DeviceController.getInstalledApplication(device);
165165
}
166166

167-
public static getDefaultDevice(args: INsCapabilities, deviceName?: string, token?: string, type?: DeviceType, platformVersion?: number) {
167+
public static getDefaultDevice(args: INsCapabilities, deviceName?: string, token?: string, type?: DeviceType, platformVersion?: number): IDevice {
168168
let device: IDevice = {
169169
name: deviceName || args.appiumCaps.deviceName,
170170
type: type,

lib/parser.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export declare const projectDir: string, projectBinary: string, pluginRoot: string, pluginBinary: string, port: number, verbose: boolean, appiumCapsLocation: string, testFolder: string, runType: string, isSauceLab: boolean, appPath: string, storage: string, testReports: string, devMode: boolean, ignoreDeviceController: boolean, wdaLocalPort: number, path: string, relaxedSecurity: boolean, cleanApp: boolean, attachToDebug: boolean, sessionId: string, startSession: boolean, capabilitiesName: string, imagesPath: string, startDeviceOptions: string, deviceTypeOrPlatform: string, device: import("mobile-devices-controller/lib/device").IDevice;
1+
export declare const projectDir: string, projectBinary: string, pluginRoot: string, pluginBinary: string, port: number, verbose: boolean, appiumCapsLocation: string, testFolder: string, runType: string, isSauceLab: boolean, appPath: string, storage: string, testReports: string, devMode: boolean, ignoreDeviceController: boolean, wdaLocalPort: number, path: string, relaxedSecurity: boolean, cleanApp: boolean, attachToDebug: boolean, sessionId: string, startSession: boolean, capabilitiesName: string, imagesPath: string, startDeviceOptions: string, deviceTypeOrPlatform: string, device: any;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-dev-appium",
3-
"version": "4.0.9",
3+
"version": "5.0.0",
44
"description": "A NativeScript plugin to help integrate and run Appium tests",
55
"author": "NativeScript",
66
"license": "MIT",
@@ -37,7 +37,7 @@
3737
"frame-comparer": "^2.0.1",
3838
"glob": "^7.1.0",
3939
"inquirer": "^6.2.0",
40-
"mobile-devices-controller": "~4.0.1-1",
40+
"mobile-devices-controller": "~4.0.1-5",
4141
"wd": "~1.11.1",
4242
"webdriverio": "~4.14.0",
4343
"yargs": "~12.0.5"

test/device-manager.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe("ios devices", () => {
6060
before("Init: DeviceManager", () => {
6161
deviceManager = new DeviceManager();
6262
appiumArgs = new NsCapabilities(<any>{});
63-
appiumArgs.extend(<any>{ appiumCaps: { platformName: Platform.IOS, fullReset: false, deviceName: /iPhone XR/ } })
63+
appiumArgs.extend(<any>{ appiumCaps: { platformName: Platform.IOS, fullReset: false, deviceName: /iPhone X/ } })
6464
appiumArgs.shouldSetFullResetOption();
6565
});
6666

@@ -218,7 +218,7 @@ describe("Start device by apiLevel", async () => {
218218
const nsCaps = new NsCapabilities({
219219
appPath: iosApp,
220220
appiumCaps: {
221-
platformVersion: /12./,
221+
platformVersion: /12.||11./,
222222
platformName: Platform.IOS,
223223
fullReset: true
224224
}

0 commit comments

Comments
 (0)