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 the eventloopIdleDelaySec capability (wdaEventloopIdleDelay for users) #881

Merged
merged 7 commits into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Differences noted here
|`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` |
|`skipLogCapture`|Skips to start capturing logs such as crash, system, safari console and safari network. It might improve performance such as network. Log related commands will not work. Defaults to `false`. |`true` or `false`|
|`useSimpleBuildTest`| Build with `build` and run test with `test` in xcodebuild for all Xcode version if this is `true`, or build with `build-for-testing` and run tests with `test-without-building` for over Xcode 8 if this is `false`. Defaults to `false`. | `true` or `false` |

|`wdaEventloopIdleDelay`|Delays the invocation of `-[XCUIApplicationProcess setEventLoopHasIdled:]` by the number of seconds specified with this capability. This can help quiescence apps that fail to do so for no obvious reason (and creating a session fails for that reason). This increases the time for session creation because `-[XCUIApplicationProcess setEventLoopHasIdled:]` is called multiple times. If you enable this capability start with at least `3` seconds and try increasing it, if creating the session still fails. Defaults to `0`. |e.g. `5`|

## Development<a id="development"></a>

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

export { desiredCapConstraints };
Expand Down
2 changes: 2 additions & 0 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ class XCUITestDriver extends BaseDriver {
let maxTypingFrequency = util.hasValue(this.opts.maxTypingFrequency) ? this.opts.maxTypingFrequency : 60;
let shouldUseSingletonTestManager = util.hasValue(this.opts.shouldUseSingletonTestManager) ? this.opts.shouldUseSingletonTestManager : true;
let shouldUseTestManagerForVisibilityDetection = false;
let eventloopIdleDelaySec = this.opts.wdaEventloopIdleDelay || 0;
if (util.hasValue(this.opts.simpleIsVisibleCheck)) {
shouldUseTestManagerForVisibilityDetection = this.opts.simpleIsVisibleCheck;
}
Expand All @@ -865,6 +866,7 @@ class XCUITestDriver extends BaseDriver {
bundleId,
arguments: args,
environment: env,
eventloopIdleDelaySec,
shouldWaitForQuiescence,
shouldUseTestManagerForVisibilityDetection,
maxTypingFrequency,
Expand Down
2 changes: 2 additions & 0 deletions test/unit/language-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('language and locale', function () {
shouldUseTestManagerForVisibilityDetection: true,
maxTypingFrequency: 60,
shouldUseSingletonTestManager: true,
eventloopIdleDelaySec: 0,
}
};
let desiredCapabilities = {
Expand Down Expand Up @@ -73,6 +74,7 @@ describe('language and locale', function () {
shouldUseTestManagerForVisibilityDetection: true,
maxTypingFrequency: 60,
shouldUseSingletonTestManager: true,
eventloopIdleDelaySec: 0,
}
};

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 @@ -24,6 +24,7 @@ describe('process args', function () {
shouldUseTestManagerForVisibilityDetection: false,
maxTypingFrequency: 60,
shouldUseSingletonTestManager: true,
eventloopIdleDelaySec: 0,
}
};

Expand Down