Skip to main content

标签

🌐 Tabs

命令描述
tab-list列出所有打开的标签页
tab-new [url]打开一个新标签页
tab-select <index>按索引切换到标签页
tab-close [index]关闭一个标签页

列出标签

🌐 Listing tabs

$ playwright-cli tab-list
# Tab 0: "TodoMVC" - https://demo.playwright.dev/todomvc [active]
# Tab 1: "Example" - https://example.com
# Tab 2: "Google" - https://google.com

创建标签页

🌐 Creating tabs

playwright-cli tab-new                  # blank tab
playwright-cli tab-new https://example.com # navigate immediately

切换标签

🌐 Switching tabs

playwright-cli tab-select 1             # switch to second tab
playwright-cli tab-select 0 # switch back to first

关闭标签页

🌐 Closing tabs

playwright-cli tab-close                # close current tab
playwright-cli tab-close 2 # close specific tab

工作流程:比较页面

🌐 Workflow: comparing pages

playwright-cli open https://staging.example.com
playwright-cli snapshot --filename=staging.yaml
playwright-cli tab-new https://example.com
playwright-cli snapshot --filename=production.yaml
# Agent compares the two snapshots