114 / 139 · 13 Browser Automation with Playwright · Production Framework← prev⊞ allnext →☰ Read as one page
13.4Test Tagging
Use tags to categorize tests for selective execution:
test('@smoke login with valid credentials', async ({ page }) => {
// Critical path — runs on every deployment
});
test('@regression cart handles 100 items', async ({ page }) => {
// Thorough — runs nightly
});
test('@slow report generation with large dataset', async ({ page }) => {
// Resource-intensive — runs on-demand
});
npx playwright test --grep @smoke # Only smoke tests
npx playwright test --grep-invert @slow # Everything except slow tests