视频录制
🌐 Video Recording
将浏览器会话录制为带章节标记的 WebM 视频。
🌐 Record browser sessions as WebM videos with chapter markers.
命令
🌐 Commands
playwright-cli video-start [filename] # start recording
playwright-cli video-chapter <title> # add chapter marker
playwright-cli video-stop # stop and save
基本录音
🌐 Basic recording
playwright-cli video-start demo.webm
playwright-cli goto https://example.com
playwright-cli click e5
playwright-cli fill e3 "test"
playwright-cli video-stop
# Video saved to: .playwright-cli/demo.webm
章节标记
🌐 Chapter markers
添加导航和审查的结构:
🌐 Add structure for navigation and review:
playwright-cli video-start
playwright-cli video-chapter "Step 1: Login"
playwright-cli goto https://app.example.com/login
playwright-cli fill e3 "user@example.com"
playwright-cli fill e5 "password"
playwright-cli click e7
playwright-cli video-chapter "Step 2: Navigate to settings"
playwright-cli goto /settings
playwright-cli video-chapter "Step 3: Update profile"
playwright-cli fill e10 "New Display Name"
playwright-cli click e15
playwright-cli video-stop
章节选项
🌐 Chapter options
playwright-cli video-chapter "Title" \
--description="Detailed description" \
--duration=2000 # show chapter card for 2 seconds
视频大小
🌐 Video size
playwright-cli video-start --size=800x600
使用案例
🌐 Use cases
| 场景 | 方法 |
|---|---|
| Bug重现 | 记录步骤,附加到问题 |
| 测试文档 | 使用章节标记记录 |
| 代理监控 | 记录代理会话以供审查 |
| 演示创建 | 记录精美的演练 |
自动录制
🌐 Automatic recording
通过 配置文件 自动记录所有会话:
🌐 Record all sessions automatically via the config file:
{
"saveVideo": { "width": 800, "height": 600 }
}
或者通过环境变量:
🌐 Or via environment variable:
PLAYWRIGHT_MCP_SAVE_VIDEO=800x600 playwright-cli open https://example.com