Playwright · Junior · Question 6 of 75
How do you run only tests whose title contains "login"?
- 1
npx playwright test -g "login" - 2
npx playwright test --only login - 3
npx playwright test --file=login
Show the answer
Correct answer: npx playwright test -g "login"
Explanation
-g (or --grep) filters tests by a regular expression on the title. You can also pass a file path or a file:line to run a specific test.