From 5ed6051c04a9b343b06e37da5ed6c143cf229f5b Mon Sep 17 00:00:00 2001 From: Wim Selles Date: Thu, 22 Aug 2019 10:21:23 +0200 Subject: [PATCH 1/2] test: update deps and speed up iOS tests with 20% --- package.json | 38 ++++++++++++++++++------------------ tests/helpers/NativeAlert.js | 2 +- tests/helpers/Picker.js | 2 +- tests/helpers/utils.js | 7 +++---- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 1e9725e9..d9ae22a2 100644 --- a/package.json +++ b/package.json @@ -32,28 +32,28 @@ "homepage": "https://github.com/webdriverio/appium-boilerplate#readme", "dependencies": {}, "devDependencies": { - "@babel/cli": "^7.4.3", - "@babel/core": "^7.4.3", - "@babel/preset-env": "^7.4.3", - "@babel/register": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "@wdio/appium-service": "^5.7.9", - "@wdio/cli": "^5.7.12", - "@wdio/jasmine-framework": "^5.7.8", - "@wdio/local-runner": "^5.7.12", - "@wdio/sauce-service": "^5.7.8", - "@wdio/spec-reporter": "^5.7.9", - "@wdio/sync": "^5.7.9", - "babel-eslint": "^10.0.1", + "@babel/cli": "^7.5.5", + "@babel/core": "^7.5.5", + "@babel/preset-env": "^7.5.5", + "@babel/register": "^7.5.5", + "@babel/traverse": "^7.5.5", + "@babel/types": "^7.5.5", + "@wdio/appium-service": "^5.12.1", + "@wdio/cli": "^5.12.4", + "@wdio/jasmine-framework": "^5.12.1", + "@wdio/local-runner": "^5.12.4", + "@wdio/sauce-service": "^5.12.1", + "@wdio/spec-reporter": "^5.12.1", + "@wdio/sync": "^5.12.3", + "babel-eslint": "^10.0.2", "eslint": "^5.16.0", "eslint-config-standard": "^12.0.0", - "eslint-plugin-import": "^2.14.0", + "eslint-plugin-import": "^2.18.2", "eslint-plugin-node": "^7.0.1", - "eslint-plugin-promise": "^4.1.1", - "eslint-plugin-standard": "^4.0.0", - "eslint-plugin-wdio": "^5.7.8", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", + "eslint-plugin-wdio": "^5.12.1", "node-fetch": "^2.3.0", - "webdriverio": "^5.7.12" + "webdriverio": "^5.12.4" } } diff --git a/tests/helpers/NativeAlert.js b/tests/helpers/NativeAlert.js index aa63300f..e97c6fe6 100644 --- a/tests/helpers/NativeAlert.js +++ b/tests/helpers/NativeAlert.js @@ -5,7 +5,7 @@ const SELECTORS = { ALERT_BUTTON: '*//android.widget.Button[@text="{BUTTON_TEXT}"]', }, IOS: { - ALERT: '*//XCUIElementTypeAlert', + ALERT: '-ios predicate string:type == \'XCUIElementTypeAlert\'', }, }; diff --git a/tests/helpers/Picker.js b/tests/helpers/Picker.js index 7e66e30e..926ff1c4 100644 --- a/tests/helpers/Picker.js +++ b/tests/helpers/Picker.js @@ -1,6 +1,6 @@ const SELECTORS = { ANDROID_LISTVIEW: '//android.widget.ListView', - IOS_PICKERWHEEL: '*//XCUIElementTypePickerWheel', + IOS_PICKERWHEEL: '-ios predicate string:type == \'XCUIElementTypePickerWheel\'', DONE: `~header-Dropdown`, }; diff --git a/tests/helpers/utils.js b/tests/helpers/utils.js index 9664dbb0..8a6ab731 100644 --- a/tests/helpers/utils.js +++ b/tests/helpers/utils.js @@ -5,8 +5,7 @@ const SELECTORS = { }, IOS: { GENERIC_TEXT: null, - XPATH_TEXT: '*//XCUIElementTypeStaticText', - TEXT_FIELD: '*//XCUIElementTypeTextField', + TEXT_ELEMENT: '-ios predicate string:type == \'XCUIElementTypeStaticText\'', }, }; @@ -25,10 +24,10 @@ export function getTextOfElement (element, isXpath = false) { if (driver.isAndroid) { visualText = element.$$(SELECTORS.ANDROID.TEXT).reduce((currentValue, el) => `${currentValue} ${el.getText()}`, ''); } else { - const iosElement = isXpath ? element.$$(SELECTORS.IOS.XPATH_TEXT) : element; + const iosElement = isXpath ? element.$$(SELECTORS.IOS.TEXT_ELEMENT) : element; if (isXpath) { - visualText = element.$$(SELECTORS.IOS.XPATH_TEXT).reduce((currentValue, el) => `${currentValue} ${el.getText()}`, ''); + visualText = element.$$(SELECTORS.IOS.TEXT_ELEMENT).reduce((currentValue, el) => `${currentValue} ${el.getText()}`, ''); } else { visualText = iosElement.getText(); } From 7817153017bd46b124b61aba563734009386973a Mon Sep 17 00:00:00 2001 From: Wim Selles Date: Thu, 22 Aug 2019 10:22:50 +0200 Subject: [PATCH 2/2] chore: update version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d9ae22a2..e0ec9f99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "appium-boilerplate", - "version": "5.2.0", + "version": "5.3.1", "description": "Boilerplate project to run WebdriverIO tests with Appium to test native applications on iOS and Android", "scripts": { "android.sauce.rdc.app": "./node_modules/.bin/wdio ./config/saucelabs/wdio.android.rdc.app.conf.js",