playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: MCP: test_debug does not pause browser with custom fixtures - only works with built-in page fixture

Open enesecer opened this issue 1 month ago • 3 comments

Version

1.56.1

Steps to reproduce

  • Clone the repo: https://github.com/enesecer/MCPIssue
  • Check the README.MD for instructions

Expected behavior

test_debug should pause on error and keep browser open for inspection with both built-in and custom fixtures. Browser interaction tools (browser_snapshot, browser_click, etc.) should be available.

Actual behavior

  • Built-in page fixture: Pauses on error, browser stays open, browser tools available
  • Custom page fixture: Runs to completion, browser closes, browser tools unavailable with error Tool not found

This breaks the HEALER agent workflow for my framework that uses custom fixtures.

Additional context

Claude Code - Sonnet 4.5 - Executing MCP tools directly without using subagents (the behavior is same with the subagents as well) MCP server added to claude: claude mcp add --transport stdio playwright-test -- npx playwright run-test-mcp-server

Environment

  IDEs:
    Claude Code: 2.0.53 
  npmPackages:
    @playwright/test: 1.56.1 => 1.56.1 
    playwright-extra: 4.3.6 => 4.3.6

enesecer avatar Nov 25 '25 17:11 enesecer

That is indeed correct, we only support the stock page fixture in the agentic workflow.

pavelfeldman avatar Nov 25 '25 20:11 pavelfeldman

Is there any plan to support custom pages as well?

Also, it would be really helpful if this information were documented somewhere. It would save me (and probably others) a lot of time. I know the agents are still new, but having clarity on what currently works and what doesn’t would be very useful.

enesecer avatar Nov 25 '25 20:11 enesecer

We will eventually fix it, but it is best if you decorate the default page instead of replacing it. There will be a limit to what we can do with the externally provided page.

pavelfeldman avatar Nov 27 '25 00:11 pavelfeldman