Playwright · Junior · Question 45 of 75
How can you tag a test to run a smoke subset?
test("checkout", { tag: "@smoke" }, async ({ page }) => {
// ...
});- 1Put the test in a folder named exactly
smoke - 2Call
test.smoke()instead oftest() - 3Add a tag and run
npx playwright test --grep @smoke
Show the answer
Correct answer: Add a tag and run npx playwright test --grep @smoke
Explanation
Tags can be set with the tag option or written in the title. --grep and --grep-invert filter by them.