From 4234389335c45d21fddcf4d489993ab8fdbaf6df Mon Sep 17 00:00:00 2001 From: SvetoslavTsenov Date: Thu, 8 Aug 2019 11:21:03 +0300 Subject: [PATCH 1/3] release: cut the 6.0.0 release --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0880b4f..3592494 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ + +# [6.0.0](https://github.com/NativeScript/nativescript-dev-appium/compare/5.3.0...6.0.0) (2019-08-08) + + +### Bug Fixes + +* typos ([65c6aa3](https://github.com/NativeScript/nativescript-dev-appium/commit/65c6aa3)) +* **image-helper:** increase image name ([#237](https://github.com/NativeScript/nativescript-dev-appium/issues/237)) ([c075af8](https://github.com/NativeScript/nativescript-dev-appium/commit/c075af8)) + + +### Features + +* image-helper ([#236](https://github.com/NativeScript/nativescript-dev-appium/issues/236)) ([0d2c9fd](https://github.com/NativeScript/nativescript-dev-appium/commit/0d2c9fd)) +* resolve symlinked storages ([#235](https://github.com/NativeScript/nativescript-dev-appium/issues/235)) ([ef270c9](https://github.com/NativeScript/nativescript-dev-appium/commit/ef270c9)) + + + # [5.3.0](https://github.com/NativeScript/nativescript-dev-appium/compare/v5.2.0...v5.3.0) (2019-06-10) From 24a3a558be4f4b744a9c491315a1173daa75c4db Mon Sep 17 00:00:00 2001 From: SvetoslavTsenov Date: Thu, 8 Aug 2019 17:22:03 +0300 Subject: [PATCH 2/3] fix: provide support for 'UiAutomator1' and set mandatory automation name --- lib/automation-name.d.ts | 1 + lib/automation-name.ts | 1 + lib/ns-capabilities.ts | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/automation-name.d.ts b/lib/automation-name.d.ts index e77c68f..d0270fa 100644 --- a/lib/automation-name.d.ts +++ b/lib/automation-name.d.ts @@ -1,5 +1,6 @@ export declare enum AutomationName { UiAutomator2 = "UIAutomator2", + UiAutomator1 = "UIAutomator1", Appium = "Appium", XCUITest = "XCUITest" } diff --git a/lib/automation-name.ts b/lib/automation-name.ts index 862156d..35e9eb7 100644 --- a/lib/automation-name.ts +++ b/lib/automation-name.ts @@ -1,5 +1,6 @@ export enum AutomationName { UiAutomator2 = "UIAutomator2", + UiAutomator1 = "UIAutomator1", Appium = "Appium", XCUITest = "XCUITest", } \ No newline at end of file diff --git a/lib/ns-capabilities.ts b/lib/ns-capabilities.ts index fd616a5..050634d 100644 --- a/lib/ns-capabilities.ts +++ b/lib/ns-capabilities.ts @@ -309,11 +309,16 @@ export class NsCapabilities implements INsCapabilities { this.automationName = AutomationName.Appium; break; case AutomationName.XCUITest.toString().toLowerCase(): this.automationName = AutomationName.XCUITest; break; + case AutomationName.UiAutomator1.toString().toLowerCase(): + this.automationName = AutomationName.UiAutomator1; break; } } else { if (this.isAndroid) { - if (this.tryGetAndroidApiLevel() >= 6 || (this.appiumCaps["apiLevel"] && +this.appiumCaps["apiLevel"]) >= 23) { + if ((this.tryGetAndroidApiLevel() >= 6 && this.tryGetAndroidApiLevel() <= 17) + || this.tryGetAndroidApiLevel() >= 23) { this.automationName = AutomationName.UiAutomator2; + }else{ + this.automationName = AutomationName.UiAutomator1; } } } @@ -332,6 +337,9 @@ export class NsCapabilities implements INsCapabilities { if (this.appiumCaps["platformVersion"]) { const apiLevel = this.appiumCaps["platformVersion"].split(".").splice(0, 2).join('.'); return +apiLevel; + }else if(this.appiumCaps["apiLevel"]){ + const apiLevel = this.appiumCaps["apiLevel"].split(".").splice(0, 2).join('.'); + return +apiLevel; } } catch (error) { } return undefined; From c2a22fa91153a53debecb2e0f3057032f4b031c5 Mon Sep 17 00:00:00 2001 From: SvetoslavTsenov Date: Thu, 8 Aug 2019 20:22:14 +0300 Subject: [PATCH 3/3] set default ios automation name XCUITest --- lib/ns-capabilities.d.ts | 1 + lib/ns-capabilities.ts | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/ns-capabilities.d.ts b/lib/ns-capabilities.d.ts index 7c94d5f..ea640cc 100644 --- a/lib/ns-capabilities.d.ts +++ b/lib/ns-capabilities.d.ts @@ -77,6 +77,7 @@ export declare class NsCapabilities implements INsCapabilities { shouldSetFullResetOption(): void; private setAutomationName; tryGetAndroidApiLevel(): number; + tryGetIOSApiLevel(): number; private resolveApplication; private checkMandatoryCapabilities; private throwExceptions; diff --git a/lib/ns-capabilities.ts b/lib/ns-capabilities.ts index 050634d..1eaab31 100644 --- a/lib/ns-capabilities.ts +++ b/lib/ns-capabilities.ts @@ -313,14 +313,23 @@ export class NsCapabilities implements INsCapabilities { this.automationName = AutomationName.UiAutomator1; break; } } else { + const apiLevel = this.tryGetApiLevel(); if (this.isAndroid) { - if ((this.tryGetAndroidApiLevel() >= 6 && this.tryGetAndroidApiLevel() <= 17) - || this.tryGetAndroidApiLevel() >= 23) { + if ((apiLevel >= 6 && apiLevel <= 17) + || apiLevel >= 23) { this.automationName = AutomationName.UiAutomator2; - }else{ + } else { this.automationName = AutomationName.UiAutomator1; } } + + if (this.isIOS) { + if (apiLevel < 10) { + logWarn("Provide automationName") + } else { + this.automationName = AutomationName.XCUITest; + } + } } if (this.automationName) { @@ -332,16 +341,15 @@ export class NsCapabilities implements INsCapabilities { } } - tryGetAndroidApiLevel() { + tryGetApiLevel() { try { - if (this.appiumCaps["platformVersion"]) { - const apiLevel = this.appiumCaps["platformVersion"].split(".").splice(0, 2).join('.'); - return +apiLevel; - }else if(this.appiumCaps["apiLevel"]){ - const apiLevel = this.appiumCaps["apiLevel"].split(".").splice(0, 2).join('.'); - return +apiLevel; + const apiLevel = this.appiumCaps["platformVersion"] || this.appiumCaps["apiLevel"]; + if (this.isAndroid && apiLevel) { + return apiLevel.split(".").splice(0, 2).join('.'); } + return apiLevel; } catch (error) { } + return undefined; }