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

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

Closed
mbouchardC3 opened this issue Feb 2, 2024 · 4 comments

Comments

@mbouchardC3
Copy link

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 mbouchardC3 changed the title [Bug]: Cannot run debug on individual tests in Playwright Test for VSCode explorer if we use the debug button [Bug]: Playwright Test for VSCode - The debug button doesn't automatically choose the right profile when running individual tests Feb 2, 2024
@mxschmitt mxschmitt removed the v1.42 label Feb 5, 2024
@mxschmitt mxschmitt removed their assignment Feb 5, 2024
@mxschmitt
Copy link
Member

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

@mbouchardC3
Copy link
Author

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)

@dgozman
Copy link
Contributor

dgozman commented Feb 6, 2024

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.

@pavelfeldman
Copy link
Member

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.

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

4 participants