Playwright Tag Annotations: Organize Tests with @smoke, @critical, @regression
Tags organize tests into subsets. Run @smoke on every PR. Run @regression nightly. Run @critical before release. No complex folder structures needed.
🎠Want to master this with real projects? Join the Playwright Automation Mastery course at The Testing Academy.
Contents
Adding Tags
test('login flow @smoke @critical', async ({ page }) => { });
test('password reset @regression', async ({ page }) => { });
test('admin panel @regression @security', async ({ page }) => { });
🚀 Level Up Your Playwright
From locators to CI pipelines — build a production-grade Playwright + TypeScript framework step by step.
Running Tagged Tests
npx playwright test --grep @smoke # Only smoke
npx playwright test --grep @critical # Only critical
npx playwright test --grep-invert @slow # Everything except slow
npx playwright test --grep "@smoke|@critical" # Smoke OR critical
CI Strategy
| Trigger | Tags | Time |
|---|---|---|
| PR | @smoke | 3 min |
| Merge | @smoke + @critical | 8 min |
| Nightly | @regression (all) | 30 min |
| Release | @critical + manual | 15 min + human |
🎓 Master Playwright End to End
Join hundreds of SDETs building real automation frameworks. Lifetime access, hands-on projects, and a job-ready portfolio.
