Playwright E2E testing patterns — web-first assertions, user-visible locators, network interception, fixtures, authentication, and parallel execution
98
99%
Does it follow best practices?
Impact
98%
1.81xAverage score across 5 eval scenarios
Passed
No known issues
A SaaS app has an admin dashboard that requires login. Write Playwright E2E tests for the dashboard.
The app runs on http://localhost:3000 with these pages:
/login -- email + password login form with a "Sign in" button/dashboard -- shows stats cards (total users, active sessions, revenue) and a users table/dashboard/users -- user management page with search, invite button, and user list/dashboard/settings -- app settings form with "Save" buttonThe app has these API endpoints:
POST /api/auth/login -- authenticates user (returns JWT in cookie)GET /api/dashboard/stats -- returns dashboard statisticsGET /api/users -- returns paginated user listPOST /api/users/invite -- sends user invitationAll dashboard pages require authentication. Unauthenticated requests redirect to /login.
Produce:
playwright.config.ts -- Playwright configuratione2e/dashboard.spec.ts -- test file for the dashboardpackage.json -- with @playwright/test dependency listedYou may create additional files for good test organization (fixtures, page objects, auth setup).