-
-
Notifications
You must be signed in to change notification settings - Fork 425
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
feat: add nativeWebTapStrict cap #1186
Conversation
const [portraitHeight, portraitWidth] = height > width ? [height, width] : [width, height]; | ||
return (portraitHeight === IPHONE_X_HEIGHT && portraitWidth === IPHONE_X_WIDTH) || | ||
(portraitHeight === IPHONE_XR_HEIGHT && portraitWidth === IPHONE_XR_WIDTH); | ||
extensions.getSafariDeviceSize = _.memoize(async function getSafariDeviceSize () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if screen orientation gets changed during the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just for deciding on the device, and it is normalized to portrait. So it does not matter.
extensions.getSafariIsNotched = _.memoize(async function getSafariIsNotched () { | ||
try { | ||
const {width, height} = await this.getSafariDeviceSize(); | ||
for (const device of NOTCHED_DEVICE_SIZES) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return NOTCHED_DEVICE_SIZES.some(({w, h}) => w === width && h === height)
return await this.proxyCommand('/appium/settings', 'POST', { | ||
settings: {[key]: value} | ||
}); | ||
} | ||
this.opts.nativeWebTap = !!value; | ||
this.opts[key] = !!value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure this is not going to break anything...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only two keys that get through to here are the native web tap ones. This is not a problem.
IMHO, this all logic that we implement on the driver level could be moved to WDA under a custom endpoint. This could speed up the execution a lot, because each proxy call requires additional time (and |
Feel free to implement it there. This should all be a last resort anyway. Most of the time atoms are a better way to do things in the web context. |
@@ -217,7 +217,10 @@ let desiredCapConstraints = _.defaults({ | |||
}, | |||
appPushTimeout: { | |||
isNumber: true | |||
} | |||
}, | |||
nativeWebTapStrict: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add in readme, too?
* fix: make sure native web tap works with full conversion works for newer devices * fix: better way of checking notch * feat: add nativeWebTapStrict cap * fix: work on failing test
Add a capability,
nativeWebTapStrict
, which skips the attempt to not convert the web coordinates. See appium/appium#14084First, this makes sure the web coordinate conversion works for newer devices.