Skip to content

Commit

Permalink
feat: add pageLoadStrategy for Safari/WebView (#2411)
Browse files Browse the repository at this point in the history
* feat: add pageLoadStrategy

* bump remote debugger

* Update capabilities.md
  • Loading branch information
KazuCocoa committed Jun 20, 2024
1 parent cd25bad commit 2517bf7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/reference/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ about capabilities, refer to the [Appium documentation](https://appium.io/docs/e

|<div style="width:10em">Capability</div>|Description|<div style="width:7em">Example</div>|
|----------|-----------|------|
|`pageLoadStrategy` | One of the available page load strategies. See https://www.w3.org/TR/webdriver/#capabilities. Default `normal`. | `eager` |
|`appium:absoluteWebLocations`|This capability will direct the `Get Element Location` command, when used within webviews, to return coordinates which are relative to the origin of the page, rather than relative to the current scroll offset. This capability has no effect outside of webviews. Default `false`.|`true`|
|`appium:safariGarbageCollect`|Turns on/off Web Inspector garbage collection when executing scripts on Safari. Turning on may improve performance. Defaults to `false`.|`true` or `false`|
|`appium:includeSafariInWebviews`|Add Safari web contexts to the list of contexts available during a native/webview app test. This is useful if the test opens Safari and needs to be able to interact with it. Defaults to `false`.|`true` or `false`|
Expand Down
1 change: 1 addition & 0 deletions lib/commands/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ const helpers = {
logAllCommunicationHexDump: this.opts.safariLogAllCommunicationHexDump,
socketChunkSize: this.opts.safariSocketChunkSize,
webInspectorMaxFrameLength: this.opts.safariWebInspectorMaxFrameLength,
pageLoadStrategy: this.caps.pageLoadStrategy,
},
this.isRealDevice(),
);
Expand Down
4 changes: 4 additions & 0 deletions lib/desired-caps.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ const desiredCapConstraints = /** @type {const} */ ({
appTimeZone: {
isString: true,
},
pageLoadStrategy: {
isString: true,
inclusionCaseInsensitive: ['none', 'eager', 'normal']
}
});

export {desiredCapConstraints, PLATFORM_NAME_IOS, PLATFORM_NAME_TVOS};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"appium-idb": "^1.6.13",
"appium-ios-device": "^2.5.4",
"appium-ios-simulator": "^6.1.7",
"appium-remote-debugger": "^11.1.0",
"appium-remote-debugger": "^11.3.0",
"appium-webdriveragent": "^8.7.0",
"appium-xcode": "^5.1.4",
"async-lock": "^1.4.0",
Expand Down

0 comments on commit 2517bf7

Please sign in to comment.