Skip to content

fix: preserve capability alternatives from option lists - #1296

Merged
KazuCocoa merged 2 commits into
appium:masterfrom
lucasmariano003-wq:codex/python-client-payload-fix
Sep 12, 2026
Merged

KazuCocoa merged 2 commits into
appium:masterfrom
lucasmariano003-wq:codex/python-client-payload-fix

Conversation

@lucasmariano003-wq

Copy link
Copy Markdown
Contributor

Description

Remote(options=[first, second]) is already accepted by the Appium constructor's type signature, but Selenium's generated W3C envelope is wrapped again as an appium:capabilities capability. The server receives one empty firstMatch entry instead of the requested alternatives.

Normalize each option's capability names before Selenium extracts common values, then preserve its alwaysMatch/firstMatch envelope. Normalizing first also prevents the default automationName and an explicit appium:automationName override from ending up in conflicting sections. Caller-owned options, nested capabilities such as proxy, and client connection settings are preserved.

Validation

  • Four new regressions fail against the original source and pass after this fix: shared/nested capabilities, automation-name overrides, different platform alternatives, and a single-item list versus one options object.
  • A real localhost HTTP fixture captures the POST emitted by Remote. It confirms the corrected envelope, unchanged input options, and preservation of the supplied AppiumClientConfig and timeout. This tests request serialization and session-response handling; it does not claim physical-device or multi-driver negotiation.
  • All 177 unit tests passed.
  • make check passed Ruff, formatting, and Mypy over 320 source files.
  • Both published files were fetched back and their hashes match the tested copies.

OpenAI Codex performed the implementation and local validation for this GitHub account; maintainer review is pending.

If accepted, please confirm whether this PR qualifies for compensation under the Appium contributor compensation scheme and the applicable amount. I understand that classification and payment remain at the project's discretion.

Normalize each Appium options object before Selenium extracts common fields and preserve its W3C capability envelope. Four regressions fail on the base and pass with the fix; 177 unit tests, type/style checks and a real localhost HTTP payload capture passed.
Complete the previously submitted source change with four regressions for common and alternative capabilities, automation overrides, mixed platforms and a single-item list. All 177 unit tests, type/style checks and real localhost HTTP serialization checks passed.
@lucasmariano003-wq

Copy link
Copy Markdown
Contributor Author

Thanks for the approval. I traced the remaining iOS failure on b1986724c9996ef9278022f490eb7d10f556c97a to WDA startup. The Appium server log records xcrun simctl launch --terminate-running-process ... com.facebook.WebDriverAgentRunner.xctrunner timing out after 600,000 ms, followed by wdaStartFailed. The client consequently hits its existing 600-second timeout during test_context fixture setup.

The next test sends an identical session payload, successfully starts WDA, and passes Safari navigation. The job ends with one passed test and one setup error. The simulator had also required two boot retries.

The Safari fixture uses a single XCUITestOptions object. I compared its actual HTTP requests using the base and PR implementations: the payloads and client timeout are unchanged. All 177 unit tests and make check pass locally. I have left the approved code unchanged. Could a maintainer re-run the failed iOS job on this head?

@KazuCocoa
KazuCocoa merged commit aa4492e into appium:master Sep 12, 2026
13 of 15 checks passed
@KazuCocoa

Copy link
Copy Markdown
Member

yes, that is fine.

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