Skip to content

Commit

Permalink
test: Update e2e-test:native-web-tap tests for WebDriverIO compatibil…
Browse files Browse the repository at this point in the history
…ity (#1490)

* drop comments out

* refactor: change to WdIO setIimeouts

* refactor: update link text locator methods

* refactor: update name locator methods

* refactor: update id locator method

* refactor: update to getTitle method

* refactor: update accessibility id locator method

* refactor: use WdIO context methods

* refactor: use getPageSource methods

* refactor: use amendCapabilities func and usePrebuiltWDA capability to comply with the other specs

* refactor: update default devices to use

while removing Travis envionment variable, assuming appium-xcuitest-driver does not use Travis anymore

* refactor: use elementSendKeys

* fix: add beforeEach to make tests stable

* fix: wrong locator to bring url bar up

* ci: enable e2e-test:native-web-tap tests

* test: drop performance check

because it looks unstable as #1490 (comment)

* test: remove ALL_DEVICES flag to avoid timeout

* refactor: use || operator for readability

* test: reset a simulator when starting nativewebtap tests

* fix: nativeWebTapStrict doesn't work on newer iPhones

* test: close tabs via GUI rather than fullReset cap

* Update ci-jobs/templates/xcuitest-e2e-template.yml

* Update ci-jobs/templates/xcuitest-e2e-template.yml

---------

Co-authored-by: Kazuaki Matsuo <[email protected]>
  • Loading branch information
mwakizaka and KazuCocoa authored Feb 6, 2023
1 parent 0dc1584 commit 12b7ab8
Show file tree
Hide file tree
Showing 4 changed files with 266 additions and 274 deletions.
5 changes: 5 additions & 0 deletions lib/commands/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ const NOTCHED_DEVICE_SIZES = [
{w: 1125, h: 2436}, // 11 Pro, X, Xs
{w: 828, h: 1792}, // 11, Xr
{w: 1242, h: 2688}, // 11 Pro Max, Xs Max
{w: 1080, h: 2340}, // 13 mini, 12 mini
{w: 1170, h: 2532}, // 14, 13, 13 Pro, 12, 12 Pro
{w: 1284, h: 2778}, // 14 Plus, 13 Pro Max, 12 Pro Max
{w: 1179, h: 2556}, // 14 Pro
{w: 1290, h: 2796}, // 14 Pro Max
];

const { W3C_WEB_ELEMENT_IDENTIFIER } = util;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"e2e-test:long": "mocha \"./test/functional/long\" --exit --timeout 10m",
"e2e-test:parallel": "mocha \"./test/functional/parallel\" --exit --timeout 10m",
"e2e-test:web": "mocha \"./test/functional/web\" --exit --timeout 10m",
"e2e-test:native-web-tap": "ALL_DEVICES=1 mocha \"./test/functional/web/safari-nativewebtap-e2e-specs.js\" --exit --timeout 10m"
"e2e-test:native-web-tap": "mocha \"./test/functional/web/safari-nativewebtap-e2e-specs.js\" --exit --timeout 10m"
},
"pre-commit": [
"precommit-msg",
Expand Down
13 changes: 6 additions & 7 deletions test/functional/desired.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ function extractCapabilityValue (caps, capName) {
return caps?.alwaysMatch?.[capName];
}

const PLATFORM_VERSION = process.env.PLATFORM_VERSION ? process.env.PLATFORM_VERSION : '11.3';
const PLATFORM_VERSION = process.env.PLATFORM_VERSION || '11.3';
const IS_ABOVE_IOS13 = util.compareVersions(PLATFORM_VERSION, '>=', '13.0');
const DEVICE_NAME = process.env.DEVICE_NAME
? process.env.DEVICE_NAME
: (IS_ABOVE_IOS13 ? 'iPhone 8' : 'iPhone 6');
const DEVICE_NAME_FOR_TOUCH_ID = process.env.DEVICE_NAME_FOR_TOUCH_ID ? process.env.DEVICE_NAME_FOR_TOUCH_ID : 'iPhone 8';
const DEVICE_NAME = process.env.DEVICE_NAME || (IS_ABOVE_IOS13 ? 'iPhone 8' : 'iPhone 6');
const DEVICE_NAME_FOR_TOUCH_ID = process.env.DEVICE_NAME_FOR_TOUCH_ID || 'iPhone 8';
const DEVICE_NAME_FOR_SAFARI_IPAD = process.env.DEVICE_NAME_FOR_SAFARI_IPAD || 'iPad Simulator';
const LAUNCH_WITH_IDB = checkFeatureInEnv('LAUNCH_WITH_IDB');
const SHOW_XCODE_LOG = checkFeatureInEnv('SHOW_XCODE_LOG');
const APPS = {
Expand Down Expand Up @@ -104,6 +103,6 @@ const TVOS_CAPS = amendCapabilities(GENERIC_CAPS, {

export {
UICATALOG_CAPS, UICATALOG_SIM_CAPS, SAFARI_CAPS, TESTAPP_CAPS,
PLATFORM_VERSION, TOUCHIDAPP_CAPS, FACEIDAPP_CAPS, DEVICE_NAME, SETTINGS_CAPS,
TVOS_CAPS, MULTIPLE_APPS, GENERIC_CAPS, amendCapabilities, extractCapabilityValue,
PLATFORM_VERSION, TOUCHIDAPP_CAPS, FACEIDAPP_CAPS, DEVICE_NAME, DEVICE_NAME_FOR_SAFARI_IPAD,
SETTINGS_CAPS, TVOS_CAPS, MULTIPLE_APPS, GENERIC_CAPS, amendCapabilities, extractCapabilityValue,
};
Loading

0 comments on commit 12b7ab8

Please sign in to comment.