React Forum
Blog & Guide Responses
Feb 10, 2023 · 04:00 AM

Playwright Intro - discussion (2023-02-10)

Started by Morgan Patel
externalplaywrighte2etestingtracesroute flowsevidencelanes

Playwright's intro is a solid framing for E2E: test cross-boundary flows (routing + data + focus), and treat traces as part of debugging rather than as test artifacts. In apps with explicit lanes and evidence keys, E2E gets dramatically more deterministic because you can assert on the contract, not on timing.

Read the docs

What evidence keys do you consider fair game for E2E assertions (lane, posture, identity), and what should stay internal? How do you keep E2E stable when the UI has streaming or duplicate reads? Do you treat traces/screenshots as a first-class debugging artifact, and how do you make them readable (logs/evidence)?

Comments (16)

Back to latest
Marisol Vega
Feb 12, 2023 · 12:12 PM

I assert on user-visible behavior first, then one evidence key for the lane.

If the lane isn't visible, E2E becomes a timer guessing game.

Dmitri Kline
Feb 18, 2023 · 06:06 AM

We print a compact contract line into the UI (debug only) so screenshots are self-contained:

txt
[tips] route=/threads/42 panel=detail lane=ok freshnessAt=2023-02-18T06:06Z

When Playwright fails, the screenshot already tells you what contract state you were in.

Keira Santos
Mar 01, 2023 · 03:03 AM

Counterpoint: asserting too much evidence can make tests brittle when vocabulary changes.

We keep evidence assertions to things that are also useful for support (lane, identity, posture).

Morgan Patel
Mar 05, 2023 · 05:05 AM

Yes. Evidence should be rename-stable because it's product meaning, not implementation detail.

If the vocabulary is churning, the contract probably isn't settled yet.

Grace McCoy
Mar 29, 2023 · 03:03 AM

Streaming UIs are hard to test unless completion targets are explicit.

We render data-stream-block=ok and E2E waits for that instead of sleeping.

Jasper Nguyen
Apr 18, 2023 · 06:18 PM

Long-form: E2E is expensive, so it should test *contracts*, not pixels.

Contracts are: route identity, lane transitions, and a few user-level expectations (text/roles).

If you're testing CSS details, you're paying E2E cost for unit-test value.

Nina Kapoor
May 10, 2023 · 10:10 AM

Traces became useful once we aligned logs to contract transitions.

If a trace includes [tips] lane=... reason=..., you can triage failures without rerunning locally.

Camille Duarte
Jun 01, 2023 · 06:06 AM

Counterpoint: E2E can become a crutch for not writing good integration tests.

We keep E2E for 3-5 key flows and rely on RTL for most behavior, both benefiting from the same evidence layer.

Owen Price
Jun 25, 2023 · 10:22 PM

We also assert on merge winner evidence when duplicate reads exist.

Otherwise E2E can pass while the UI is actually inconsistent (list and detail disagree).

Benji Rios
Jul 21, 2023 · 07:07 AM

Long-form counterpoint: if you don't have deterministic lanes, E2E is just an expensive flake generator.

The best E2E investment is improving the app's observability, not adding retries.

Lina Ortega
Aug 19, 2023 · 07:19 PM

Docs tie-in: evidence + testing posture is consistent across the docs and guides.

Related: Testing and Debugging and Routing and Navigation.

Amina Farouk
Sep 18, 2023 · 12:12 PM

We also used Playwright to validate focus scheduling flows (especially with overlays).

If focus moves incorrectly, it's often invisible in unit tests but obvious in E2E.

Evan Brooks
Oct 15, 2023 · 03:15 PM

Counterpoint: too much reliance on data-* can hide accessibility issues.

If you can assert by role and name, do it. Evidence keys should supplement, not replace, semantic UI.

Theo Bennett
Nov 12, 2023 · 04:04 AM

We keep one contract summary line in the UI specifically for E2E and support, not just for devs.

It's basically the "state of the world" sentence and it's worth its weight in gold.

Salma Qureshi
Dec 02, 2023 · 02:02 AM

Long-form: Playwright becomes a product tool when traces are readable.

Readable traces require that the app exposes truth: lanes, identity, and reasons. Otherwise you're just watching a video of a spinner.

Rowan Pierce
Dec 20, 2023 · 06:18 PM

We also made back/forward part of E2E because it's the fastest way to catch hidden-state bugs.

If back/forward doesn't replay your contract, users will notice.

Jules Kwon
Dec 31, 2023 · 09:09 AM

If you want stable E2E, invest in contract observability first.

Then tests become shorter, and failures become explainable instead of mysterious.