[Bug] [VSCODE extension]: Multi-root workspaces with playwright confuses the extension, both test suites never show up
Version
1.46.1
Steps to reproduce
- Clone my repo
https://github.com/alexrecuenco/playwright-multiroot-report -
cd playwright-multiroot-report -
npm installin bothaandb - Open it with
code ./report-playwright.code-workspaceto open a multi-root workspace - Go to the
TestingView, - See that not both
aandbever show up, and if you refresh you get either a or b showing up their tests suites
Expected behavior
I see both test suites, the test suites of a and b
Actual behavior
The test suite of a shows up, or b , it appears to be random
Additional context
We currently have multiple projects. And I prefer to have them all collected into one workspace from which to work, and playwright seems to be causing some conflict
Environment
System:
OS: macOS 14.6.1
CPU: (8) arm64 Apple M2
Memory: 87.95 MB / 16.00 GB
Binaries:
Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
Yarn: 1.22.22 - /opt/homebrew/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
IDEs:
VSCode: 1.92.2 - /usr/local/bin/code
Languages:
Bash: 5.2.26 - /opt/homebrew/bin/bash
npmPackages:
@playwright/test: ^1.46.1 => 1.46.1
I would put it in microsoft/playwright-vscode but that repository doesn't allow issues. So I imagine you want the report here
I also saw this, but I have managed to get around it. I have a branch here with instructions on reproducing it.
💡 Note that I am using the v1.1.10 pre-release version (not sure if that makes a difference)
I managed to get it to work with the following steps:
-
Click on the playwright gear icon at the bottom of the test view:
-
Select the missing project(s):
Now both projects are showing up in the test window and I can run them with the top-level controls:
@alexrecuenco could you try this as well on the latest VSCode extension version?
Hey, nop. Same issue with v1.1.11. I just tried it by cloning the repo with the steps provided above.
But @LiamLamb steps seem to circumvent this issue
Are the steps I showed difficult to replicate?
I was able to reproduce that when you open the projects initially, you sometimes get a and sometimes b shown. This is because we pick internally the first one which resolves from findFiles which has a non-deterministic order. I created a patch to workaround this here: https://github.com/microsoft/playwright-vscode/pull/563.
To address the issue that only one project is getting listed I was able to fix by enabling it. See the following steps similar to the ones shown in https://github.com/microsoft/playwright/issues/32338#issuecomment-2423659833.
- Open "Testing" view
- In Playwright click the gear icon:
- Make sure to select both projects:
How do you get the Playwright VSCode extension to detect tests at all? I've tried with opening the sub-folder. I've tried with a multi-root workspace. It always says there are no tests. I've looked at all the extension documentation. Nothing works. :/