[Feature]: Make it possible to configure which projects are run by default
🚀 Feature Request
Instead of running all projects be default, I wish to be able to configure default projects (like with the command line option --project) directly in playwright.config.ts
Example
You add a new option like
{...
defaultProjects: '*-default',
...}
Motivation
We have some special tests that we group by projects that need special setup, usually also longer running, so we usually do want to run those during "normal" development on a developer machine. However, it is very nice that one can opt-in, for example also with the UI, to have them run locally. So it would be nice to have a set of default projects that run instead just letting all run - this helps to have a good DX for use, so developers do not need to fiddle with the command line argument themselves. So it is more a convenience thing that people do not have to set up those cli options themselves to get sensible defaults.
Hi Eckhard! Have you tried putting a helper script into your package.json? That's what we do with the Playwright tests themselves, and that works perfectly. Something like this:
{
"scripts": {
"test": "npx playwright test --project=\"*-default\""
}
}
Hello Simon,
Well, we could do this, but I would still like having this in a configuration file:
- Currently, we have a plain yarn wrapper that just call playwright, now we would need a wrapper just for the test and teach people to do so.
- The configuration is then split over some places again - I makes more sense to be able to configure the base in a configuration file and then have CLI option for overrides. But here it feels like the default is pushed to a CLI option.
Best, Eckhard
Why was this issue closed?
Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.
If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.