Skip to content

Commit

Permalink
feat: Add disableAutomaticScreenshots capability (appium#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmacete authored Mar 24, 2021
1 parent 62e12e1 commit 255a81a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Capability | Description
|`appium:screenshotQuality`| Changes the quality of phone display screenshots following [xctest/xctimagequality](https://developer.apple.com/documentation/xctest/xctimagequality?language=objc) Default value is `1`. `0` is the highest and `2` is the lowest quality. You can also change it via [settings](https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/settings.md) command. `0` might cause OutOfMemory crash on high-resolution devices like iPad Pro. | e.g. `0`, `1`, `2` |
|`appium:autoAcceptAlerts`| Accept all iOS alerts automatically if they pop up. This includes privacy access permission alerts (e.g., location, contacts, photos). Default is `false`. |`true` or `false`|
|`appium:autoDismissAlerts`| Dismiss all iOS alerts automatically if they pop up. This includes privacy access permission alerts (e.g., location, contacts, photos). Default is `false`. |`true` or `false`|
|`appium:disableAutomaticScreenshots`| Disable automatic screenshots taken by XCTest at every interaction. Default is up to `WebDriverAgent`'s config to decide, which currently defaults to `true`. |`true` or `false`|

### Simulator

Expand Down
3 changes: 3 additions & 0 deletions lib/desired-caps.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ let desiredCapConstraints = _.defaults({
},
includeDeviceCapsToSessionInfo: {
isBoolean: true,
},
disableAutomaticScreenshots: {
isBoolean: true,
}
}, iosDesiredCapConstraints);

Expand Down
1 change: 1 addition & 0 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,7 @@ class XCUITestDriver extends BaseDriver {
waitForIdleTimeout: this.opts.waitForIdleTimeout,
shouldUseCompactResponses: this.opts.shouldUseCompactResponses,
elementResponseFields: this.opts.elementResponseFields,
disableAutomaticScreenshots: this.opts.disableAutomaticScreenshots,
};
if (this.opts.autoAcceptAlerts) {
wdaCaps.defaultAlertAction = 'accept';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"appium-ios-simulator": "^3.25.1",
"appium-remote-debugger": "^8.13.2",
"appium-support": "^2.47.1",
"appium-webdriveragent": "^3.4.0",
"appium-webdriveragent": "^3.6.0",
"appium-xcode": "^3.8.0",
"async-lock": "^1.0.0",
"asyncbox": "^2.3.1",
Expand Down
1 change: 1 addition & 0 deletions test/unit/language-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('language and locale', function () {
const BUNDLE_ID = 'com.test.app';
const DEFAULT_CAPS = {
elementResponseFields: undefined,
disableAutomaticScreenshots: undefined,
shouldUseCompactResponses: undefined,
waitForIdleTimeout: undefined,
shouldWaitForQuiescence: true,
Expand Down
1 change: 1 addition & 0 deletions test/unit/processargs-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('process args', function () {
let proxySpy = sinon.stub(driver, 'proxyCommand');
const DEFAULT_CAPS = {
elementResponseFields: undefined,
disableAutomaticScreenshots: undefined,
shouldUseCompactResponses: undefined,
waitForIdleTimeout: undefined,
shouldWaitForQuiescence: true,
Expand Down

0 comments on commit 255a81a

Please sign in to comment.