最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

typescript - Playwright CLI - Exclude specific foldersub-folder - Stack Overflow

programmeradmin1浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 2

You 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

发布评论

评论列表(0)

  1. 暂无评论