React Forum
Blog & Guide Responses
Jan 28, 2023 · 04:00 AM

Playwright Intro - discussion (2023-01-28)

Started by Lena Fischer
externalplaywrighte2etestingtracesroute flowsevidence

Playwright's intro is a good reminder that E2E isn't about testing everything—it's about testing flows that cross boundaries (routing, data freshness, authentication posture). In apps that lean on visible evidence keys and route contracts, E2E gets a lot more deterministic.

Read the docs

What do you assert on in E2E: user-visible text/roles, or evidence attributes as well? How do you keep traces useful when the app has a lot of async lane changes? Do you use E2E to validate "route posture" (cache lanes, motion keys), or keep that in unit/integration tests?

Comments (12)

Back to latest
Marisol Vega
Feb 01, 2023 · 06:18 PM

I assert user-visible content first, then one evidence key per flow.

If the evidence key explains the flow (lane/posture/identity), it makes failures obvious.

Dmitri Kline
Feb 07, 2023 · 05:05 AM

Evidence + traces is a great combo. We print a tiny "tips trace" line into the page so it ends up in screenshots:

txt
[tips] route=/threads/42 panel=detail lane=ok freshnessAt=2023-02-07T05:05Z

Then Playwright failures read like a story, not like a flake.

Keira Santos
Feb 15, 2023 · 09:09 AM

Counterpoint: asserting too much evidence can make tests brittle if you rename the vocabulary.

I keep evidence assertions to things I'd want in a customer support screenshot anyway.

Lena Fischer
Feb 18, 2023 · 04:04 AM

Same. I treat evidence like a UI label: rename it only when the product meaning changes.

Then tests stay stable.

Grace McCoy
Mar 03, 2023 · 03:03 AM

We use E2E for "did navigation + data fetching + rendering posture compose correctly".

Unit tests can't give you that confidence.

Jasper Nguyen
Mar 20, 2023 · 08:20 PM

Traces stay useful when you align your logs to contract transitions:

txt
[tips] lane=pending reason=nav:click
[tips] lane=ok reason=fetch:resolve
[tips] motion=list->detail remountKey=thread:42
Nina Kapoor
Apr 11, 2023 · 11:11 AM

We also use Playwright's built-in tracing/screenshot to validate accessibility affordances (focus, keyboard).

Even when the app postpones full keyboard support, traces help you see regressions.

Camille Duarte
May 02, 2023 · 04:40 AM

Counterpoint: E2E is expensive; if you don't have deterministic contracts, you just get expensive flakes.

The contract/evidence posture is what makes E2E worth it.

Amina Farouk
May 06, 2023 · 06:06 AM

Yes. Evidence lanes are basically flake prevention.

You stop guessing when async work is finished.

Owen Price
Jun 12, 2023 · 12:12 PM

We keep route posture in E2E: cache lane, render cadence, panel key.

If you ship those postures, you should test them end-to-end at least once.

Benji Rios
Jul 08, 2023 · 06:18 PM

A cool trick is to make the evidence keys accessible via aria-describedby on a debug element.

Then Playwright can assert on it like normal content without relying on attributes.

Sofia Valdez
Aug 23, 2023 · 03:33 AM

Docs tie-in: the routing posture docs explain why E2E failures often look like routing bugs but are actually contract bugs.

Related: Routing and Navigation and Testing and Debugging.

Theo Bennett
Oct 05, 2023 · 05:05 AM

Playwright's locator ergonomics also nudged us to improve markup (roles/labels).

Better tests and better UI come together when you lean into semantics.

Tomas Rivera
Dec 02, 2023 · 10:22 PM

The intro doc is great, but the real unlock is: treat trace artifacts as part of your debugging workflow, not just test output.

When you pair traces with contract logs, triage becomes fast.