-
Notifications
You must be signed in to change notification settings - Fork 135
Closed
microsoft/playwright
#39281Description
Bug Description
When using the multi-tab feature with tab-select, the snapshot command outputs incorrect metadata in the "Page" section. It displays tab 0's URL and Title even when a different tab is selected as current.
Steps to Reproduce
-
Start a session and open a page:
playwright-cli -s=test open --headed "https://portal.azure.com" -
Create a new tab and navigate to a different site:
playwright-cli -s=test tab-new "https://example.com" -
Verify current tab:
playwright-cli -s=test tab-list
Output shows tab 1 is current:
- 0: [portal.azure.com] - 1: (current) [Example Domain] -
Take snapshot:
playwright-cli -s=test snapshot
Expected Behavior
The snapshot output should show:
### Page
- Page URL: https://example.com/
- Page Title: Example Domain
Actual Behavior
The snapshot output incorrectly shows tab 0's information:
### Page
- Page URL: https://portal.azure.com/
- Page Title: Microsoft Azure
However:
- The snapshot YAML content itself IS correct (shows example.com page structure)
- The
evalcommand confirms the correct URL/title - The bug is only in the snapshot metadata display
Impact
This creates confusion when testing multi-tab workflows, as agents/users see conflicting information between the "Page" metadata and the actual snapshot content.
Environment
- playwright-cli version: Latest (installed via
npx @playwright/cli@latest) - OS: macOS
- Browser: Chrome (headed mode)
Workaround
Use eval to verify the actual page:
playwright-cli -s=test eval "() => ({ url: window.location.href, title: document.title })"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels