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 3 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ Differences noted here
|`permissions`| Allows to set permissions for the specified application bundle on Simulator only. The capability value is expected to be a valid JSON string with `{"<bundleId1>": {"<serviceName1>": "<serviceStatus1>", ...}, ...}` format. It is required that `applesimutils` package is installed and available in PATH. The list of available service names and statuses can be found at https://github.com/wix/AppleSimulatorUtils. | e. g. `{"com.apple.mobilecal": {"calendar": "YES"}}` |
|`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`|
|`eventloopIdleDelaySec`|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`|
Copy link
Member

Choose a reason for hiding this comment

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

👍


## 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
},
eventloopIdleDelaySec: {
Copy link
Member

Choose a reason for hiding this comment

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

wdaEventloopIdleDelay here as README?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes of course. Mixed the two names up...

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 = util.hasValue(this.opts.eventloopIdleDelaySec) ? this.opts.eventloopIdleDelaySec : 0;
mykola-mokhnach marked this conversation as resolved.
Show resolved Hide resolved
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