Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Make it possible to configure which projects are run by default #33838

Open
seckii opened this issue Dec 2, 2024 · 2 comments
Open

Comments

@seckii
Copy link

seckii commented Dec 2, 2024

🚀 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.

@Skn0tt
Copy link
Member

Skn0tt commented Dec 3, 2024

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\""
   }
}

@seckii
Copy link
Author

seckii commented Dec 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants