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] Reused browser (of VS code extension) doesn't work when chrome extensions are used #20470

Closed
lukaskl opened this issue Jan 28, 2023 · 1 comment

Comments

@lukaskl
Copy link

lukaskl commented Jan 28, 2023

Context:

  • Playwright Version: 1.30.0
  • Operating System: Mac
  • Node.js version: v18.12.1
  • Visual Studio Code version: Version: 1.74.3 (Universal), Commit: 97dec172d3256f8ca4bfb2143f3f76b503ca0534
  • Playwright for VSCode extension version: 1.0.6
  • Browser: Chromium

Code Snippet

I have created a repository where this issue is reproducible: https://github.com/lukaskl/playwright-report

But in short, when using chrome-extensions as suggested here Reused Browser (Show browser checkbox) stops to work.

Describe the bug

Expected

After executing the test browser should stay open and other features such as Pick locator should still be working:

playwright-show-browser-working.mp4

Actual

Browser immediately closes once test finishes:

playwright-show-browser-not-working.mp4

Notes

I'm really not sure whether the chrome extensions is to blame here but I've put that into the title as this was my use case.
It might be just the const context = await chromium.launchPersistentContext("", { ... }) or something else.

It also might be that it is necessary to update the code on my side, but in this case what changes should be made? And also maybe it would be healthy to update the documentation?

@dgozman
Copy link
Contributor

dgozman commented Jan 30, 2023

@lukaskl This is because you manually launch the browser with chromium.launchPersistentContext() and then manually close it with context.close().

Reuse browser mode in VSCode extension only works with regular contexts that are provided by the test runner out of the box, i.e. with built-in page and context. I don't think it will work for your scenario in the near future, sorry.

@dgozman dgozman closed this as completed Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants