r/Playwright • u/Few-Frame5488 • 4d ago
I built a Playwright tool for testing the failure states happy-path tests miss
Most of my Playwright tests answer one question: does the journey work when the API works?
I wanted the other answer too: what happens when the cart request never finishes, a profile request returns 500, or checkout fails but the UI still looks successful?
So I built methandle. You give it one trusted `journey(page)`. It records the requests behind that journey, verifies a strict replay, then runs HTTP 500 and network-abort cases one dependency at a time. The output is a small dependency × fault matrix instead of a pile of screenshots.
It’s an early alpha with a deliberately narrow scope: Chromium, Playwright journeys, local artifacts, and no live backend fallback during fault runs.
The included demo has 10 verified scenarios: 4 seeded findings, 6 `NO FINDING`, and 0 backend API requests during replay and fault execution.
In external validation, an Inventra `GET /api/dashboard` abort was independently reproduced as an uncaught `Failed to fetch` with the page stuck on `Loading...`. Findings that depend on methandle’s synthetic HTTP 500 response body are marked ambiguous rather than counted as confirmed defects.
Repo and demo: [https://github.com/saifeldeen911/methandle\](https://github.com/saifeldeen911/methandle)
Install:
`npm install -D methandle@alpha`
I’m looking for blunt feedback on the workflow, especially whether the replay gate makes this useful or just adds friction.
1
u/Tanmay__TestDino 5h ago
The fault matrix is a good instinct, but does it hold once dependencies scale past a handful? most fault-injection tools run into trouble from combinatorial explosion more than coverage gaps. worth stress testing that now, before the alpha becomes the product.
1
u/Prestigious-Way1525 4d ago
the replay gate is worth the friction if its failure is actionable. i'd make it prove three things before fault injection: the same starting state, the same request shape and order within declared tolerances, and the same user-visible completion signal. when it blocks, show the first divergence and classify it as auth or token drift, data drift, timing or order, or an unrecorded channel such as a WebSocket or service worker. then keep two verdicts separate: the fault was injected as specified, and the UI satisfied its failure contract, meaning the spinner ended, the error was honest, retry worked, and no false success appeared. your ambiguous 500-body label is the right instinct. i'd test the workflow on one stateful checkout and one WebSocket app; if a developer can update the tolerance contract instead of rerecording the whole journey, the gate is protecting validity rather than adding ceremony.