Skip to content

Redesign playwright-examples to use Sauce's native Playwright WebSocket endpoint - #438

Merged
diemol merged 3 commits into
mainfrom
playwright-native-websocket-endpoint
Jul 28, 2026
Merged

Redesign playwright-examples to use Sauce's native Playwright WebSocket endpoint#438
diemol merged 3 commits into
mainfrom
playwright-native-websocket-endpoint

Conversation

@diemol

@diemol diemol commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Replaces the old WebDriver-session + CDP approach (Chrome/Edge only) with Sauce's native /playwright/session WebSocket endpoint, which also supports Firefox and WebKit.
  • Sessions are grouped per test class by default (one Sauce job per class); a single JUnit5 config switch (-Djunit.parallel.mode.default=concurrent) gives every test its own independent session instead. A session that sees a failure is closed and reported immediately rather than reused by the next test.
  • Drops the sauce_bindings, saucerest, and lombok dependencies - their small slice of functionality (build naming, job reporting/renaming) is now a few lightweight classes using java.net.http.HttpClient.
  • Adds a SortingTest class for coverage parity.
  • CI browser matrix moves from [Chrome, MicrosoftEdge] to [chromium, firefox, webkit] (Playwright's own engine names - the native endpoint doesn't distinguish Chrome from Edge, both are Chromium).
  • Adds JUnit XML test reporting via dorny/test-reporter.

Test plan

  • mvn clean test-compile (JDK 21)
  • Verified against real Sauce Labs: default grouped mode (5 sessions, one per class, all passing)
  • Verified against real Sauce Labs: full-parallel mode (-Djunit.parallel.mode.default=concurrent, 19 sessions, one per test method, all passing)
  • Verified failure-recycling live (a real test failure closed/reported its session immediately and opened a fresh one for the rest of that class)
  • Verified StandaloneTest still passes after the saucerest removal
  • CI (formatting, standalone, suite) - pending on this PR

🤖 Generated with Claude Code

diemol and others added 3 commits July 28, 2026 09:39
…et endpoint

Replaces the old WebDriver-session + CDP approach (Chrome/Edge only) with
Sauce's native /playwright/session WebSocket endpoint, which also supports
Firefox and WebKit. Sessions are grouped per test class by default, with a
single JUnit5 config switch (junit.parallel.mode.default) to run every test
in its own independent session instead. A session that sees a failure is
closed and reported immediately rather than reused by the next test.

Also drops the sauce_bindings, saucerest, and lombok dependencies, replacing
their (small) slice of functionality with a few lightweight classes and
java.net.http.HttpClient, and adds a JUnit XML test report via
dorny/test-reporter to the CI workflow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The formatting check in CI runs the real tool; my manual re-wrapping of a
few over-100-column lines (done without local access to the formatter)
guessed slightly differently in three spots.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
My previous fix over-merged the orElseThrow lambda onto one line, pushing
it back over 100 columns from a different angle. Applying the formatter's
own diff exactly this time instead of re-guessing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@diemol
diemol merged commit cbd0fd7 into main Jul 28, 2026
5 checks passed
@diemol
diemol deleted the playwright-native-websocket-endpoint branch July 28, 2026 10:01
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.

1 participant