-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
Add reduce motion #760
Add reduce motion #760
Conversation
lib/driver.js
Outdated
@@ -337,6 +337,11 @@ class XCUITestDriver extends BaseDriver { | |||
await shutdownOtherSimulators(this.opts.device); | |||
} | |||
|
|||
// set reduceMotion if desired | |||
if (this.opts.reduceMotion) { |
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.
if util.hasValue(...)
can you append the capability in README? |
if (!process.env.REAL_DEVICE) { | ||
it('should enable reduce motion', async function () { | ||
driver = await initSession(caps); | ||
let el = await driver.elementsByXPath('//XCUIElementTypeCell[@name="General"]'); |
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.
xpath locators are slow. Please use either accessibility id or predicate locators instead
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.
for example:
accessiblityId: General
predicate: type == 'XCUIElementTypeCell' AND name == 'General'
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.
reading docs since I never used accessiblityId
.
it('should enable reduce motion', async function () { | ||
driver = await initSession(caps); | ||
let el = await driver.elementsByXPath('//XCUIElementTypeCell[@name="General"]'); | ||
await el[0].click(); |
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.
why you are looking for elements
if you only need a single one?
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.
my bad. Changing that.
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.
same questions as @mykola-mokhnach but otherwise LGTM
if (!process.env.REAL_DEVICE) { | ||
it('should enable reduce motion', async function () { | ||
driver = await initSession(caps); | ||
let el = await driver.element('-ios predicate string', "type == 'XCUIElementTypeCell' AND name == 'General'"); |
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.
'-ios predicate string' can be a constant
const udid = await createDevice(SIM_DEVICE_NAME, | ||
SETTINGS_CAPS.deviceName, SETTINGS_CAPS.platformVersion); | ||
baseCaps = Object.assign({}, SETTINGS_CAPS, {udid}); | ||
caps = Object.assign({usePrebuiltWDA: true, "reduceMotion": true}, baseCaps); |
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.
quotes are redundant
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.
left some comments, otherwise lgtm 👍
Do these tests work locally for you? Turning off doesn't seem to work. |
* add new capability for setting reduceMotion on simulators * call reduceMotion * use util.hasValue * add functional test for reduceMotion * update appium-ios-simulator version * add capabilities for settings app * update comment desc * add line break * update readme, add reduceMotion capabiilty * update functional tests * update readme, add reduceMotion capabiilty * update readme, add reduceMotion capabiilty * update functional tests * fix test
[Work in progress]
Add reduceMotion for simulators