Skip to content

WebKit cross-browser e2e tests fail due to Playwright WebRTC limitation #97

Description

@dallen4

Summary

WebKit cross-browser Playwright e2e tests (Chrome↔WebKit, Firefox↔WebKit) consistently fail with WebRTC ICE negotiation errors. These 4 test projects have been disabled in the test config pending a resolution.

Background

These tests were previously passing under yarn v1 with an older version of Playwright. The failures surfaced during the pnpm migration (chore/pnpm-migration branch), which also bumped Playwright to 1.58.x. It's unclear whether the root cause is the Playwright version bump, a behavioral difference in how pnpm resolves/hoists Playwright's browser binaries, or a combination.

What fails

The 4 cross-browser projects involving WebKit:

  • Chrome to WebKit
  • Firefox to WebKit
  • WebKit to Chrome
  • WebKit to Firefox

Errors observed:

  • Grabber (WebKit): "Error: Negotiation of connection to X failed." — PeerJS ICE negotiation never completes
  • Dropper (WebKit): "Attempt limit exceeded for type: handshake" — DataChannel never opens, retry loop exhausted

What passes

  • Standalone webkit project — both dropper and grabber in the same WebKit browser context/process
  • Mobile Safari — same single-process pattern
  • All Chrome/Firefox combos — including cross-browser (Chrome to Firefox, Firefox to Chrome)

What we investigated

  1. TURN server config — added turn:80?transport=tcp and turns:443?transport=tcp variants, switched to standard.relay.metered.ca. No effect.
  2. Fixture-managed vs manually launched WebKit — changed cross-browser projects to use ...devices['Desktop Safari'] so WebKit runs as the Playwright fixture browser instead of via browser.launch(). Still fails — rules out launch configuration as the cause.
  3. Rate limiting — a separate race condition with test tokens was fixed via globalSetup, but WebKit failures persisted after.
  4. Permissions — WebKit throws "Unknown permission" for microphone/camera, but these aren't needed (DataChannel only, no media streams).

Root cause

Playwright's WebKit engine has limited WebRTC support when peers are in separate browser processes. When both peers share the same WebKit browser context (standalone project), ICE negotiation succeeds. When one peer is in a separately launched browser process (even another WebKit), ICE fails.

This is a known Playwright limitation — WebRTC testing support for WebKit has been an open request since 2020.

Relevant Playwright issues

Current mitigation

The 4 WebKit cross-browser projects have been removed from playwright.config.ts. WebKit coverage is maintained via:

  • Standalone webkit project (full drop→grab flow in single process)
  • Mobile Safari project (iPhone 12 viewport)
  • Chrome↔Firefox cross-browser projects (validates cross-engine WebRTC interop)

To revisit

  • Monitor Playwright releases for WebKit WebRTC improvements
  • If Playwright adds --enable-mock-capture-devices or similar WebKit flags, test whether cross-process ICE negotiation is fixed
  • Consider testing with real Safari via Playwright's connect API or a cloud browser service (BrowserStack/Sauce Labs) for true cross-browser WebKit validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions