browser
Opens browser at URL for E2E testing via playwright-cli. Provides CLI commands for navigation, screenshots, and interaction. Triggers on keywords: browser, open browser, playwright browser, e2e browser
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Browser Command
Open browser for E2E testing using playwright-cli.
Target URL: $ARGUMENTS
If no URL provided, default to: http://localhost:${DEFAULT_PORT:-5173}/
Pre-Flight Checks
-
Verify playwright-cli Installed
- Run:
playwright-cli --help - If not available: STOP with error "playwright-cli not installed. Run: npm install -g @playwright/cli@latest && playwright-cli install-browser"
- Run:
Execution
-
Navigate to URL
playwright-cli open "${URL:-http://localhost:${DEFAULT_PORT:-5173}/}" -
Verify Page Load
playwright-cli snapshotReport page title and URL from snapshot output.
-
Report Status
- Confirm browser is open and ready
- Display current page title
- Display current URL
Available CLI Commands
After opening browser, these commands are available via Bash:
-
playwright-cli goto <url>- Navigate to URL -
playwright-cli snapshot- Capture accessibility snapshot -
playwright-cli click "<selector>"- Click element -
playwright-cli fill "<selector>" "<text>"- Fill input field -
playwright-cli type "<text>"- Type text -
playwright-cli screenshot- Take PNG screenshot -
playwright-cli close- Close browser session -
playwright-cli video-start/video-stop- Record video
Notes
- Video recording is explicit: use
playwright-cli video-startbefore the flow andvideo-stopafter - Configure output via
playwright-cli.jsonin project root - Use
--headedflag for visible browser window:playwright-cli --headed open <url> - Port can be configured via DEFAULT_PORT environment variable
- Sessions persist across commands: use
playwright-cli -s=<name>for named sessions
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!