Playwright · Junior · Question 45 of 75

How can you tag a test to run a smoke subset?

test("checkout", { tag: "@smoke" }, async ({ page }) => {
  // ...
});
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.

Further reading

Problem with a question

Playwright · Junior · question 45

Test yourself

Take the Playwright · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz