Skip to content

feat(options): add missing XCUITest capabilities - #2509

Open
hoanle0126 wants to merge 2 commits into
appium:masterfrom
hoanle0126:feat/xcuitest-options-parity
Open

hoanle0126 wants to merge 2 commits into
appium:masterfrom
hoanle0126:feat/xcuitest-options-parity

Conversation

@hoanle0126

Copy link
Copy Markdown
Contributor

Change list

Add typed option interfaces on XCUITestOptions for active appium-xcuitest-driver capabilities that did not have getters and setters yet.

Types of changes

  • No changes in production code.
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Details

Added 16 option interfaces covering these capabilities:

  • App: appTimeZone, initialDeeplinkUrl
  • WebDriverAgent: appLaunchStateTimeoutSec, iosInstallPause, wdaRemotePort, wdaBindingIP, updatedWDABundleIdSuffix, prebuildWDA, mjpegScreenshotUrl
  • Simulator: reduceTransparency, autoFillPasswords, simulatorLogLevel, skipSyncUiDialogTranslation
  • Web context: ignoredWebviewBundleIds, webviewAtomWaitTimeout
  • Other: iosSyslogFile

Added unit tests covering default values, fluent chaining, capability serialization, and copy-constructor coercion.

@mykola-mokhnach mykola-mokhnach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking issues found. Capability names, value types and units match the appium-xcuitest-driver docs, and the new options follow the existing Supports*Option pattern. One minor inline note below.

@SuppressWarnings("unchecked")
default Optional<List<String>> getIgnoredWebviewBundleIds() {
return Optional.ofNullable(
(List<String>) getCapability(IGNORED_WEBVIEW_BUNDLE_IDS_OPTION)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[minor] The driver docs say appium:ignoredWebviewBundleIds accepts an "Array (or JSON array)". If it is supplied as a JSON string, e.g. new XCUITestOptions(Map.of("appium:ignoredWebviewBundleIds", "[\"com.apple.amsengagementd\"]")), getIgnoredWebviewBundleIds() throws ClassCastException (String cannot be cast to List). Consider handling a String value by parsing it as a JSON array, or at least document that only List is supported. The copy-constructor test only covers the List form.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 7d87af46. Updated getIgnoredWebviewBundleIds() to parse JSON array strings into an unmodifiable string list and reject non-array or non-string values with IllegalArgumentException, with tests added in XCUITestOptionsParityTest.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants