Post

1/ End-to-end tests are supposed to give you confidence. Instead, many Playwright setups create… chaos. Here’s why (and what to do instead) 🧵

3/ Signs your Playwright setup is failing • Flaky tests due to shared state or data interference • Failures on retries because of leftover state • Tests wasting time on repetitive UI setup • Symptoms reappearing unexpectedly

4/ The core problem: too much setup in the UI. If half your suite is just logging in, preparing users, etc., you’re doing it wrong.

5/ The alternative: API-driven test data Create your users, subscriptions, and test state via API instead of the UI. Use fixtures to inject that data into Playwright.

6/ This approach lets your tests focus on behavior, not scaffolding. It leads to faster suites, easier maintainability, and more confidence.

7/ Use shared fixtures. If external dependencies fail (e.g. a third-party API), it should be handled at the fixture level — not in every single test.

0 reposts0 likes

8/ Page objects & explicit concurrency control Define structured interactions (buying a product, making an order) in a page object. Use Promise.all to wait for both actions + requests so your test doesn’t break due to timing nuances.

9/ In short: ✅ Start with stable foundations ✅ Invest in API-level setup early ✅ Use fixtures, page objects, and shared abstractions Your test suite should speed you up, not slow you down.

10/ When you build your test setup the right way from day one, you’re much less likely to lose trust in it later. Your future self (and your team) will thank you.