playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature]: Add possibility to run debug for only selected browser window(s)

Open ilkkanisula opened this issue 6 months ago • 1 comments

🚀 Feature Request

Add possibility to focus debug to selected browser windows by run debug like this:

npx run test --debug-only=ERP 
npx run test --debug-only=ERP,eComm 

ERP could be a attached to a group with windowGroup property in browser.newPage({ windowGroup: "ERP" })

ERP window would run in debug mode with debug window open. Rest of the browsers would run in background in headless mode.

PlaywrightTestConfig could have list of known window groups listed if that helps with the implementation and newPage could check the windowGroup name against the list:

{
  use: {
    windowGroups: ['ERP', 'eComm']
  }
}

Current way to achieve this: Run test in --debug mode and manually click "play" button in all other windows except the one you want to run line by line and manually minimize all other windows.

Example

We have 3 browser windows openened to 4 systems in a test. And let's say we know we want to debug only "main" window. When using --debug-only=main would show only single headed window and single debug panel compared to 8 windows popping up.

Motivation

This allows you to easily repeat tests with only one window popping open and rest in headless automatic mode.

Having less windows opened in debug mode helps in debugging tests.

ilkkanisula avatar Aug 22 '24 09:08 ilkkanisula