How to write a maintainable first E2E test
Когда использовать: You have a staging URL and a login flow; you want one solid test before scaling.
Предварительные требования
- Skill installed — git clone https://github.com/testdino-hq/playwright-skill ~/.claude/skills/playwright-skill
- @playwright/test installed — npm init playwright@latest
Поток
-
Describe the flowWrite a Playwright test for login at staging.example.com: email, password, expect dashboard heading. Use role-based locators only.✓ Скопировано→ Test using getByRole, getByLabel; no .class or xpath
-
Add auth reuse fixtureConvert the login into a reusable auth fixture so other tests skip logging in.✓ Скопировано→ storageState-based fixture + globalSetup
-
Ensure non-flakinessAudit the test for waitFor* anti-patterns; switch to web-first assertions.✓ Скопировано→ expect(locator).toBeVisible() rather than waitForSelector
Итог: A robust first test plus a fixture the whole suite inherits.
Подводные камни
- Claude reaches for page.waitForTimeout — Tell skill explicitly: no arbitrary waits, use web-first assertions