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

feat: switch reduce motion via settings API #1065

Merged

Conversation

KazuCocoa
Copy link
Member

related to appium/WebDriverAgent#202

Before:

  • Can configure the setting only when before launching simulators (It requires to reset simulator)

After:

  • Can change the setting without closing simulator

lib/driver.js Outdated
* @param {?boolean} motion Wether enable reduceMotion
*/
async setReduceMotion (motion) {
if (this.isSimulator()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (this.isRealDevice() || !_.isBoolean(isEnabled)) {
  return;
}
...

lib/driver.js Outdated
/**
* Set reduceMotion as 'motion' or set false if no 'reduceMotion' in capabilities.
* It works only on simulator.
* @param {?boolean} motion Wether enable reduceMotion
Copy link
Contributor

Choose a reason for hiding this comment

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

how about isEnabled?

lib/driver.js Outdated
@@ -1146,6 +1143,19 @@ class XCUITestDriver extends BaseDriver {
}
}

/**
* Set reduceMotion as 'motion' or set false if no 'reduceMotion' in capabilities.
* It works only on simulator.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather say - the call is ignored for real devices

lib/driver.js Outdated
return;
}

log.info(`set reduceMotion to ${isEnabled}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Setting ...

@KazuCocoa KazuCocoa merged commit eb30406 into appium:master Sep 9, 2019
@KazuCocoa KazuCocoa deleted the km/switch-reduce-motion-to-settings-call branch September 9, 2019 14:01
khanayan123 pushed a commit to khanayan123/appium-xcuitest-driver that referenced this pull request May 10, 2021
…r pref (appium#1065)

* Call settins api to reduceMotion instead of changing simulator config

* extract setReduceMotion

* bump wda version

* fix review, set false by default

* ignore reduceMotion when no reduceMotion is in caps

* tweak log wording
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

2 participants