playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: Playwright Test for VSCode - The debug button doesn't automatically choose the right profile when running individual tests

Open mbouchardC3 opened this issue 1 year ago • 3 comments

Version

1.41.1

Steps to reproduce

  1. Have a testdir directing to a testsuite which contains test.describes that refers to tests located outside of the testdir
  2. Go to the Playwright Test for VSCode test explorer and run debug on the test suite using the "Debug" button
  3. No problem!
  4. Run debug one of the individual tests under it using the "Debug" button
  5. Error: Selected test is outside of the Default Profile (config)

image

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) image

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

mbouchardC3 avatar Feb 02 '24 20:02 mbouchardC3

Would it be possible that you share a reproduction repository with us?

mxschmitt avatar Feb 05 '24 16:02 mxschmitt

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)

Playwright Issue - 29328.zip

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!

Test Explorer example (2024-02-05_11-59-30)

mbouchardC3 avatar Feb 05 '24 17:02 mbouchardC3

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.

dgozman avatar Feb 06 '24 18:02 dgozman

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.

pavelfeldman avatar Apr 03 '24 21:04 pavelfeldman