playwright: [BUG] page.pause() does not stop
Context:
- Playwright Version: 1.20.1
- Operating System: Win 10 pro
- Node.js version: 16.13.1
- Browser: Chromium
Code Snippet
Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:
await this.page.pause()
Describe the bug
page.pause() stopped stopping and just steps forward, so no way to access the inspector and the recorder. No option changed, and been like this v18 I think. Is there an option to disable the pause() call?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 15 (7 by maintainers)
using
debuggerdoesn’t really replacepage.pausebecause it’s effectively the exact same as a breakpoint. i usepage.pausewhen i want to pause the execution without halting the event loop (ie. to work around issues like #10897 and #11668).another use case is:
here, i want to pause execution once the site loads so i can manually poke around and hit the brekpoint in
page.routeonce a matching request is intercepted. if i replace thatawait page.pause()with adebuggerstatement, i can’t do anything because navigation hangs until the event loop resumesnow i have to resort to something like
await page.waitForTimeout(9999999)which isn’t idealClosing as per above since this behaviour is intentional. You can either use the VS Code debugger (or any other debugger) or the Playwright Inspector. Having both in parallel is contra productive.
I agree. It’s useful functionality, and not clear why remove it. You can name it something else, make it work when a flag is set, etc. Playwright is an excellent project from Microsoft, along with Vscode, but this feels like Windows 11 dropping the vertical talkbar. Some people like it that way… 😃