I have a playwright project that has many sub folders under the tests
folder, for example a
, b
, and c
.
In a specific scenario on one of my pipelines I need to exclude the folder c
using Playwright CLI.
Please note that I don't want to create a dedicated playwright.config
file, nor setting a dedicated playwright project. (no change to the source code at all)
Only thing I found is a way to specify the wanted folders like so npx playwright test tests/todo-page/
, but not the other way around.
Is there any possible way to exclude that folder?
I have a playwright project that has many sub folders under the tests
folder, for example a
, b
, and c
.
In a specific scenario on one of my pipelines I need to exclude the folder c
using Playwright CLI.
Please note that I don't want to create a dedicated playwright.config
file, nor setting a dedicated playwright project. (no change to the source code at all)
Only thing I found is a way to specify the wanted folders like so npx playwright test tests/todo-page/
, but not the other way around.
Is there any possible way to exclude that folder?
Share Improve this question asked 22 hours ago I.sh.I.sh. 1,9931 gold badge11 silver badges36 bronze badges1 Answer
Reset to default 2You can use --grep-invert as the folder structure is part of the test name. To exclude e.g. tests/smoke:
npx playwright test --grep-invert "^tests\/smoke"
Source: Playwright CLI docs