playwright
playwright copied to clipboard
[Bug]: Playwright Test for VSCode - The debug button doesn't automatically choose the right profile when running individual tests
Version
1.41.1
Steps to reproduce
- Have a testdir directing to a testsuite which contains test.describes that refers to tests located outside of the testdir
- Go to the Playwright Test for VSCode test explorer and run debug on the test suite using the "Debug" button
- No problem!
- Run debug one of the individual tests under it using the "Debug" button
- Error: Selected test is outside of the Default Profile (config)
Expected behavior
Run debug works on individual tests as well
Actual behavior
Error: Selected test is outside of the Default Profile (config)
Additional context
I must clarify that it worked without any problem until recently when we updated Playwright from v1.38.0 to v1.41.1 and node from v14 to v20.
Also, I haven't touched my default profiles, but they are all selected (I have 5 of them)
Workaround !! If we right-click on the test, select "Execute Using Profile" and manually select the correct test profile, it launches without any issue
Environment
System:
OS: Windows
CPU: Good enough, don't worry
Binaries:
Node: 20.11.0
npm: 10.4.0
npmPackages:
@playwright/test: 1.41.1 => 1.41.1
Would it be possible that you share a reproduction repository with us?
I cannot share with you my repository, as it contains private company information.
Although I made an example using template data. Here's the zip file (obviously, it doesn't contain all necessary files like utils or others, but should be enough for understanding the issue)
Also, here's an updated template for the Test Explorer with the zip file I gave you.
Let me know if I can help furthermore! Thank you!
Investigation notes:
VSCode has a notion of a tag, he can tag projects and files/tests. These are not our tags. We create project tags for our projects and add them for every test.
If you have 2 profiles and click on a test, where first profile is a default, but test is tagged by the second profile's tag, so VSCode will run it with the second profile.
We can probably now have our own UI for project/config selection in Playwright's web view to avoid issues around this.
We no longer have multiple vscode projects, we manage it using our own UI now. Closing as addressed please file an issue once we ship the new version of the extension if the issue persists or has surfaced in a different form.