diff --git a/README.md b/README.md index 273eb502e..49e5a7986 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/WebDriverAgent b/WebDriverAgent index f6a3d6680..5896cce5a 160000 --- a/WebDriverAgent +++ b/WebDriverAgent @@ -1 +1 @@ -Subproject commit f6a3d6680a7666a8bee46d77956c1d24472df147 +Subproject commit 5896cce5a3ae386cf1874f3554ca462861a904df diff --git a/lib/desired-caps.js b/lib/desired-caps.js index 0330a108d..ff70bceec 100644 --- a/lib/desired-caps.js +++ b/lib/desired-caps.js @@ -168,6 +168,9 @@ let desiredCapConstraints = _.defaults({ skipLogCapture: { isBoolean: true }, + wdaEventloopIdleDelay: { + isNumber: true + }, }, iosDesiredCapConstraints); export { desiredCapConstraints }; diff --git a/lib/driver.js b/lib/driver.js index 6ffde0365..6c30ac974 100644 --- a/lib/driver.js +++ b/lib/driver.js @@ -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; } @@ -865,6 +866,7 @@ class XCUITestDriver extends BaseDriver { bundleId, arguments: args, environment: env, + eventloopIdleDelaySec, shouldWaitForQuiescence, shouldUseTestManagerForVisibilityDetection, maxTypingFrequency, diff --git a/test/unit/language-specs.js b/test/unit/language-specs.js index 5da6fba99..2395da44c 100644 --- a/test/unit/language-specs.js +++ b/test/unit/language-specs.js @@ -24,6 +24,7 @@ describe('language and locale', function () { shouldUseTestManagerForVisibilityDetection: true, maxTypingFrequency: 60, shouldUseSingletonTestManager: true, + eventloopIdleDelaySec: 0, } }; let desiredCapabilities = { @@ -73,6 +74,7 @@ describe('language and locale', function () { shouldUseTestManagerForVisibilityDetection: true, maxTypingFrequency: 60, shouldUseSingletonTestManager: true, + eventloopIdleDelaySec: 0, } }; diff --git a/test/unit/processargs-specs.js b/test/unit/processargs-specs.js index 89889c991..1c1100719 100644 --- a/test/unit/processargs-specs.js +++ b/test/unit/processargs-specs.js @@ -24,6 +24,7 @@ describe('process args', function () { shouldUseTestManagerForVisibilityDetection: false, maxTypingFrequency: 60, shouldUseSingletonTestManager: true, + eventloopIdleDelaySec: 0, } };