QuickDevGuide

Home › Playwright

CI/CD Integration — Playwright

GitHub Actions Docker Execution Best Practices # Practice Reason 1 Use codegen for initial tests Faster test creation 2 Prefer role-based locators Resilient to CSS changes 3 Run in CI with retries Handle flaky network conditions 4 Use trace on failure Debug without reproducing issues 5 Test mobile viewports Catch responsive design issues 6 Mock external APIs Faster, deterministic tests 7 Reuse auth state Avoid logging in for every test Don'ts # Anti-pattern Correct Approach 1 Use CSS selectors Prefer getByRole, getByLabel 2 Hard-code timeouts Rely on auto-wait 3 Skip cross-browser Test Chromium, Firefox, WebKit 4 Ignore flaky tests Fix root cause or add retries

Key Takeaways