Skip to content

feat(ios): support gateway WDA base URLs - #3187

Merged
quanru merged 8 commits into
mainfrom
feat/ios-wda-base-url-3180
Sep 27, 2026
Merged

quanru merged 8 commits into
mainfrom
feat/ios-wda-base-url-3180

Conversation

@quanru

@quanru quanru commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add wdaBaseUrl so iOS can reach WebDriverAgent through HTTPS gateways and arbitrary path prefixes.
  • Use the same base URL for readiness checks, session creation, and subsequent WDA commands. Reject configurations that combine wdaBaseUrl with wdaHost or wdaPort instead of silently applying precedence.
  • Expose the option in the iOS SDK, Playground, CLI tools, and generated Midscene Test projects, with English and Chinese documentation.
  • Keep gateway path identifiers out of report identities, request logs, and Playground metadata.
  • Add a separate wdaMjpegUrl for remote HTTP(S) MJPEG streams, with URL/port conflict validation, HTTPS Playground proxying, and safe fallback to screenshot polling.
  • Preserve gateway target identity in Studio with a digest of the complete connection, while keeping the displayed label readable and the original connection values available for session reconnection.
  • Export replayable iOS YAML using wdaBaseUrl, wdaMjpegUrl, and optional session references through environment variables. Keep gateway paths and tokens out of recordings and exports.
  • Keep existing host/port recordings visible in Studio history after the target format change.
  • Fix MJPEG test cleanup typing discovered by PR CI.
  • Exercise the path-prefixed WDA connection against the live iOS Simulator in PR CI, alongside the existing host/port smoke flow.
  • Correct the English and Chinese YAML documentation: URL and host/port options are mutually exclusive. Clarify separate MJPEG configuration and Studio Recorder exports.

Closes #3180.

Validation

  • pnpm run lint
  • pnpm exec nx build @midscene/test
  • pnpm exec nx run-many -t test -p @midscene/webdriver @midscene/core @midscene/ios @midscene/test --parallel=2
  • pnpm exec nx run-many -t test -p @midscene/ios @midscene/test --parallel=2
  • pnpm exec nx run-many -t build -p @midscene/ios @midscene/test --parallel=2
  • pnpm exec nx test @midscene/ios
  • pnpm exec nx build @midscene/ios
  • pnpm exec nx run-many -t test -p @midscene/ios @midscene/playground @midscene/test --parallel=2
  • pnpm exec nx run-many -t build -p @midscene/ios @midscene/playground @midscene/test --parallel=2
  • pnpm exec nx test @midscene/playground
  • pnpm exec nx build @midscene/shared
  • pnpm exec nx test studio
  • pnpm exec nx build studio
  • pnpm exec rstest run tests/unit-test/platform-session-manager.test.ts (from packages/ios)
  • pnpm exec vitest run tests/playground-selectors.test.ts tests/studio-recorder.test.ts (from apps/studio)
  • pnpm run type-check:tests
  • pnpm exec rstest run tests/unit/mjpeg-stream-handler.test.ts (from packages/playground)
  • AI_TEST_TYPE=iOS pnpm exec rstest run tests/ai/ios-simulator-smoke.test.ts (from packages/ios; live tests skip locally without the CI simulator flag)

The gateway URL flow is covered with mocked HTTP requests for both /code/wda and /wda/code prefix layouts. Conflict checks cover the SDK, Playground, and CLI tools. MJPEG tests cover independent HTTPS URLs, legacy HTTP streams, URL validation, and polling fallback. Studio tests cover gateway paths on the same host, reconnection values, recording history isolation, and safe YAML export. PR CI runs a real iOS Simulator and WDA through both direct host/port and a local path-prefixed HTTP gateway. A physical iPhone or external HTTPS gateway was not available for device validation.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0a201e8
Status: ✅  Deploy successful!
Preview URL: https://ddf63d6a.midscene.pages.dev
Branch Preview URL: https://feat-ios-wda-base-url-3180.midscene.pages.dev

View logs

@quanru
quanru merged commit 1ccfa12 into main Sep 27, 2026
19 checks passed
@quanru
quanru deleted the feat/ios-wda-base-url-3180 branch September 27, 2026 14:04
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.

[Feature]: Can iOS support custom full WDA base URL and arbitrary path prefix?

2 participants