Comfy-Org / Comfy-Org/ComfyUI_frontend

Extract iOS and WKWebView Playwright setup into reusable fixtures

Open
#13,976 1 comment 1 reaction 1 assignee Claimed by @christian-byrne View on GitHub
area:testing developer experience
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary
Move the iOS browser and embedded-WKWebView Playwright setup currently defined in `browser_tests/tests/cloudLoginIosWebview.spec.ts` into reusable browser-test fixtures so future tests can target the `mobile-safari` project/platform without duplicating user-agent, browser-context, and bridge setup.

## Rationale
The current focused SSO coverage needs to simulate:
- iOS first-party browsers, including Chrome iOS/Safari behavior.
- Embedded WKWebView behavior via a `window.webkit.messageHandlers` bridge.
- Project-specific execution under `mobile-safari`.

Keeping this setup local to one spec makes additional iOS/platform tests harder to write consistently and risks divergent implementations.

## Affected areas
- `browser_tests/fixtures/ComfyPage.ts` and/or related Playwright fixture modules.
- `browser_tests/tests/cloudLoginIosWebview.spec.ts`.
- `playwright.config.ts` only if fixture/project integration requires adjustments.
- Playwright guidance/documentation if the new fixture API needs usage examples.

## Required changes
- Provide reusable fixture helpers or fixture variants for iOS browser contexts and embedded WKWebView simulation.
- Centralize the canonical iOS user-agent values and WKWebView bridge initialization.
- Ensure bridge initialization occurs before navigation.
- Refactor the existing iOS cloud-login test to consume the reusable setup.
- Document the intended API/pattern for future `@mobile-ios` tests.

## Acceptance criteria
- A new Playwright test can opt into iOS first-party-browser and embedded-WKWebView environments without redefining the user agent or `window.webkit` bridge.
- The reusable setup runs correctly in the `mobile-safari` project.
- Existing `cloudLoginIosWebview.spec.ts` coverage uses the shared fixture/helper.
- Tests continue to initialize webview bridge state before application navigation.

Requested by: @christian-byrne

Backlinks:
- PR #13924: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13924
- Review discussion: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13924#discussion_r3634171240

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.