Skip to content

Commit

Permalink
formatting and supported attributes are added in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
swngarg-lt committed Nov 12, 2024
1 parent 348e9a5 commit dc198c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/reference/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Along with the common settings, the following driver-specific settings are avail
| `nativeWebTapSmartAppBannerVisibility` | `enum` | The same as `nativeWebTapTabBarVisibility`, this keyword will bypass finding whether the existence of the _**smart app banner**_. |
| `safariTabBarPosition` | `string` | Handle offset of Safari tab bar in `nativeWebTap` enabled interactions. If `platformVersion` was greater than or equal to 15 and iPhone device, the value is `bottom` by default. Otherwise `top`. When the value is `top`, Appium considers offset as the bar length. iOS 15+ environment can customize the bar position in the settings app, so please adjust the offset with this. Acceptable values: `bottom`, `top` |
| `useJSONSource` | `boolean` | See the description of the corresponding capability. |
| `pageSourceExcludedAttributes` | `string` | One or more comma-separated attribute names to be excluded from the output. It might be sometimes helpful to exclude, for example, the `visible` attribute, to significantly speed-up page source retrieval. Defaults to an empty string. Example: `"visible,accessible"` |
| `pageSourceExcludedAttributes` | `string` | One or more comma-separated attribute names to be excluded from the output. It might be sometimes helpful to exclude, for example, the `visible` attribute, to significantly speed-up page source retrieval. Attributes which can be excluded with `useJSONSource` are frame, enabled, visible, accessible and focused. Defaults to an empty string. Example: `"visible,accessible"` |
| `maxTypingFrequency` | `int` | Maximum frequency of keystrokes for typing and clear. If your tests are failing because of typing errors, you may want to adjust this. Defaults to `60` keystrokes per minute. |
| `respectSystemAlerts` | `boolean` | Currently we detect the app under test as active if XCTest returns XCUIApplicationStateRunningForeground state for it. In case the app under test is covered by a system alert from the Springboard app this approach might be confusing as we cannot interact with it unless an alert is properly handled. If this setting is set to true (by default it is false) then it forces WDA to verify the presence of alerts shown by Springboard and return the latter while performing the automated app detection. It affects the performance of active app detection, but might be more convenient for writing test scripts (e.g. eliminates the need of proactive switching between system and custom apps). Also, this behavior emulates the legacy active application detection logic before version 6 of the driver. |
| `webScreenshotMode` | `native` or `page` or `viewport` | Defines the screenshoting logic if the current context is set to a web one. The default value is `native`, which makes the driver to take screenshots from WDA, e.g. the whole device screen including status bars. The `page` mode tries to retrieve the screenshot of the whole active web page, while the `viewport` one only retrieves a shot of the visible viewport. |
Expand Down
5 changes: 4 additions & 1 deletion lib/commands/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const commands = {
return await this.executeAtom('execute_script', [script, []]);
}

const { pageSourceExcludedAttributes: excludedAttributes, useJSONSource: useJSONSource } = await this.settings.getSettings();
const {
pageSourceExcludedAttributes: excludedAttributes,
useJSONSource: useJSONSource
} = await this.settings.getSettings();
const hasExcludedAttributes = _.isString(excludedAttributes) && !_.isEmpty(excludedAttributes);
if (useJSONSource) {
const srcTree = await this.mobileGetSource('json', hasExcludedAttributes ? excludedAttributes : undefined);
Expand Down

0 comments on commit dc198c4

Please sign in to comment.