Skip to content
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

Merged
merged 15 commits into from
Oct 1, 2018
Merged

Add reduce motion #760

merged 15 commits into from
Oct 1, 2018

Conversation

vrunoa
Copy link
Contributor

@vrunoa vrunoa commented Sep 4, 2018

[Work in progress]
Add reduceMotion for simulators

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if util.hasValue(...)

@KazuCocoa
Copy link
Member

can you append the capability in README?
https://github.com/appium/appium-xcuitest-driver#desired-capabilities

if (!process.env.REAL_DEVICE) {
it('should enable reduce motion', async function () {
driver = await initSession(caps);
let el = await driver.elementsByXPath('//XCUIElementTypeCell[@name="General"]');
Copy link
Contributor

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

Copy link
Contributor

@mykola-mokhnach mykola-mokhnach Sep 9, 2018

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'

Copy link
Contributor Author

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();
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad. Changing that.

Copy link
Member

@jlipps jlipps left a 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'");
Copy link
Contributor

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quotes are redundant

Copy link
Member

@KazuCocoa KazuCocoa left a 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 👍

@imurchie
Copy link
Contributor

Do these tests work locally for you? Turning off doesn't seem to work.

@imurchie imurchie merged commit f633020 into appium:master Oct 1, 2018
khanayan123 pushed a commit to khanayan123/appium-xcuitest-driver that referenced this pull request May 10, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants