mbolotov / intellij-playwright

1 stars 0 forks source link

[Feature Request] Allow mechanism to specify how to find project root #10

Open zakhenry opened 2 years ago

zakhenry commented 2 years ago

I think this relates to the change that closed #3 and #6 - as I understand it Maestro reads up from the current directory the test is in until it finds a dir with a package.json file. This might work for some monorepos, but in my case I am using NX which has only one package.json (at the root), whereas I have multiple applications which have different playwright.config.ts files.

Would it be possible to configure the plugin so that it decides where to stop looking for a project base? In my case (NX) it would be either the existence of project.json, or actually playwright.config.ts.

here's a (cut down) example of the conventional directory structure in NX:

.
├── apps
│   ├── app-a
│   ├── app-a-e2e
│   │   ├── playwright.config.ts
│   │   ├── project.json
│   │   └── tests
│   │       └── example.spec.ts
│   ├── app-b
│   └── app-b-e2e
│       ├── playwright.config.ts
│       ├── project.json
│       └── tests
│           └── example.spec.ts
└── package.json
zakhenry commented 1 year ago

@mbolotov any update on this one? My workaround workflow is quite fustrating - I need to play a test from the margin and let it fail then update the Run configuration program arguments to point to the appropriate path.

There is a workaround for one project which is to set a configuration template which I have done, but that means only one of my many projects in the monorepo works first time when clicking play

mbolotov commented 1 year ago

Sorry, I have still no time to look into it... ( However, you can create and modify a run configuration with a single click without having to run it before: image

zakhenry commented 1 year ago

Yep, true, though as it works for some of my tests (I have the base template configured for one project) I forget and am often in the habit of just running it and then remembering to adjust the config