playwright-cli
Skill200 starsChanged 44 days agoMITView on GitHub
自动化浏览器交互、测试网页以及处理Playwright测试用例
- Installs packages
188 other projects use a version of this, 166 of them edited.
Adopted by
Most recently taken up by
- nitesh00747/PromtDrivenAutomation_JavaScriptedited, first seen Nov 29, 2026
- spenserhale/skillstheir own version, first seen Nov 29, 2026
- aakash1552005/universal-agent-skillsedited, first seen Nov 29, 2026
- appshapes/brigadeedited, first seen Nov 29, 2026
- alibaba-damo-academy/ScholarSeedtheir own version, first seen Nov 29, 2026
- Maikozort/claude-skillsedited, first seen Nov 29, 2026
Used with
Projects with it also use scopesentry, ecosystem-reference and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Doyoun510Skillscopesentry
ScopeSentry MCP를 통해 보안 스캔 플랫폼(프로젝트, 작업, 템플릿, 자산, 노드)을 관리합니다. 사용자가 ScopeSentry, MCP, API Key, 스캔 작업, 자산 조회를 언급할 때 사용합니다.
Also in 5 projects that use this
naman10parikhSkillecosystem-reference
Quick-access directory of Claude Code ecosystem repos, skills, plugins, MCPs, and patterns. Use when improving the harness.
Also in 5 projects that use this
naman10parikhSkillfractal-delegation
Also in 5 projects that use this
dotlabshqSkillapi-recon
API reconnaissance: endpoint discovery, authentication mechanism analysis, OpenAPI/Swagger/GraphQL schema collection, HTTP method testing, and API versioning enumeration. Maps the full API attack surface before exploitation. Use when: starting API testing, discovering endpoints from documentation or JS files, or mapping authentication and authorization boundaries.
Also in 5 projects that use this
MicrosoftSkillfabric-cli
How to use fabric-app-data CLI to manage Fabric data source connections. Maintain workspace/item IDs in a fabric.yaml file with profiles, add connections by ID or Fabric portal URL, and generate TypeScript config for use with @microsoft/fabric-app-data.
Also in 10 projects that use this
MicrosoftSkillfabric-sdk
How to use @microsoft/fabric-app-data to connect web applications to Fabric data sources at runtime. Build browser-based apps that query semantic models via DAX using the FabricClient API.
Also in 10 projects that use this
- +5 more from naman10parikh
Other versions188 projects use a version of this.
Word for word · 0
None found.
Edited · 166
- microsoft/playwright★ 101k23% same
- BaaRai/ARTEX★ 25k32% same
- coleam00/Archon★ 24k32% same
- microsoft/playwright-cli★ 16k24% same
- dotnet/eShop★ 11k37% same
- TypeCellOS/BlockNote★ 10k34% same
- sanity-io/sanity★ 6.4k46% same
- github/gh-aw★ 5.7k37% same
- jiwoochris/artex-ko★ 3.6k32% same
- pwndoc/pwndoc★ 2.9k45% same
156 more not listed
Wrote their own version · 22
- zebbern/claude-code-guide★ 4.7ksame name
- testdino-hq/playwright-skill★ 426same name
- mizchi/skills★ 425same name
- fugazi/test-automation-skills-agents★ 273same name
- alibaba-damo-academy/ScholarSeed★ 51same name
- diegovasquez-ai/builder-crm★ 40same name
- pskoett/pmx-canvas★ 33same name
- ulises-jeremias/agent-toolkit★ 28same name
- appautomaton/webmaton★ 20same name
- diegovasquez-ai/skills-app★ 14same name
12 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- algorithmic-artSkill
- arch-system-troubleshooterSkill
- canvas-designSkill
- chart-generatorSkill
- code-reviewerSkill
- doc-coauthoringSkill
- docxSkill
- frontend-designSkill
- mcp-builderSkill
- pdfSkill
- pptxSkill
- skill-creatorSkill
- systematic-debuggingSkill
- theme-factorySkill
- xlsxSkill
The file
Files
playwright-cli 浏览器自动化工具
🔴 ⚠️ 【强制规则,必须遵守】⚠️ 🔴 🔴 所有调用
playwright-cli open的命令,必须默认加上--headed参数! 🔴 仅用户明确要求使用无头模式时,才可去掉该参数! 🔴 禁止后台静默运行浏览器,必须显示窗口!
快速入门
# 打开新浏览器
playwright-cli open
# 跳转到指定页面
playwright-cli goto https://playwright.dev
# 使用快照中的元素引用与页面交互
playwright-cli click e15
playwright-cli type "page.click"
playwright-cli press Enter
# 截图(较少使用,快照功能更常用)
playwright-cli screenshot
# 关闭浏览器
playwright-cli close命令说明
核心命令
playwright-cli open
# 打开浏览器并直接跳转到指定url
playwright-cli open https://example.com/
playwright-cli goto https://playwright.dev
playwright-cli type "搜索关键词"
playwright-cli click e3
playwright-cli dblclick e7
# --submit参数会在填充元素后自动按回车提交
playwright-cli fill e5 "user@example.com" --submit
playwright-cli drag e2 e8
playwright-cli hover e4
playwright-cli select e9 "选项值"
playwright-cli upload ./document.pdf
playwright-cli check e12
playwright-cli uncheck e12
playwright-cli snapshot
playwright-cli eval "document.title"
playwright-cli eval "el => el.textContent" e5
# 获取快照中不显示的元素id、class或其他属性
playwright-cli eval "el => el.id" e5
playwright-cli eval "el => el.getAttribute('data-testid')" e5
playwright-cli dialog-accept
playwright-cli dialog-accept "确认文本"
playwright-cli dialog-dismiss
playwright-cli resize 1920 1080
playwright-cli close导航命令
playwright-cli go-back
playwright-cli go-forward
playwright-cli reload键盘命令
playwright-cli press Enter
playwright-cli press ArrowDown
playwright-cli keydown Shift
playwright-cli keyup Shift鼠标命令
playwright-cli mousemove 150 300
playwright-cli mousedown
playwright-cli mousedown right
playwright-cli mouseup
playwright-cli mouseup right
playwright-cli mousewheel 0 100导出命令
playwright-cli screenshot
playwright-cli screenshot e5
playwright-cli screenshot --filename=page.png
playwright-cli pdf --filename=page.pdf标签页命令
playwright-cli tab-list
playwright-cli tab-new
playwright-cli tab-new https://example.com/page
playwright-cli tab-close
playwright-cli tab-close 2
playwright-cli tab-select 0存储命令
playwright-cli state-save
playwright-cli state-save auth.json
playwright-cli state-load auth.json
# Cookie操作
playwright-cli cookie-list
playwright-cli cookie-list --domain=example.com
playwright-cli cookie-get session_id
playwright-cli cookie-set session_id abc123
playwright-cli cookie-set session_id abc123 --domain=example.com --httpOnly --secure
playwright-cli cookie-delete session_id
playwright-cli cookie-clear
# LocalStorage操作
playwright-cli localstorage-list
playwright-cli localstorage-get theme
playwright-cli localstorage-set theme dark
playwright-cli localstorage-delete theme
playwright-cli localstorage-clear
# SessionStorage操作
playwright-cli sessionstorage-list
playwright-cli sessionstorage-get step
playwright-cli sessionstorage-set step 3
playwright-cli sessionstorage-delete step
playwright-cli sessionstorage-clear网络命令
playwright-cli route "**/*.jpg" --status=404
playwright-cli route "https://api.example.com/**" --body='{"mock": true}'
playwright-cli route-list
playwright-cli unroute "**/*.jpg"
playwright-cli unroute开发者工具命令
playwright-cli console
playwright-cli console warning
playwright-cli network
playwright-cli run-code "async page => await page.context().grantPermissions(['geolocation'])"
playwright-cli run-code --filename=script.js
playwright-cli tracing-start
playwright-cli tracing-stop
playwright-cli video-start video.webm
playwright-cli video-chapter "章节标题" --description="详细说明" --duration=2000
playwright-cli video-stop原始输出模式
全局参数--raw会去掉页面状态、生成代码和快照部分的输出,仅返回结果值,适合将命令输出管道到其他工具使用。没有输出的命令执行后不会返回任何内容。
playwright-cli --raw eval "JSON.stringify(performance.timing)" | jq '.loadEventEnd - .navigationStart'
playwright-cli --raw eval "JSON.stringify([...document.querySelectorAll('a')].map(a => a.href))" > links.json
playwright-cli --raw snapshot > before.yml
playwright-cli click e5
playwright-cli --raw snapshot > after.yml
diff before.yml after.yml
TOKEN=$(playwright-cli --raw cookie-get session_id)
playwright-cli --raw localstorage-get theme启动参数
# 启动时指定使用的浏览器,可选值:chrome, firefox, webkit, msedge
playwright-cli open --browser=chrome
playwright-cli open --browser=firefox
playwright-cli open --browser=webkit
playwright-cli open --browser=msedge
# 使用持久化浏览器配置文件(默认使用内存中的临时配置,关闭后清空所有数据)
playwright-cli open --persistent
# 自定义持久化配置文件的存储目录
playwright-cli open --profile=/path/to/profile
# 通过扩展连接到浏览器
playwright-cli attach --extension
# 通过通道名连接到正在运行的Chrome或Edge
playwright-cli attach --cdp=chrome
playwright-cli attach --cdp=msedge
# 通过CDP端点连接到正在运行的浏览器
playwright-cli attach --cdp=http://localhost:9222
# 从指定配置文件启动
playwright-cli open --config=my-config.json
# 关闭浏览器
playwright-cli close
# 删除默认会话的用户数据
playwright-cli delete-data快照功能
每次命令执行后,playwright-cli都会返回当前浏览器状态的快照。
> playwright-cli goto https://example.com
### 页面信息
- 页面URL: https://example.com/
- 页面标题: Example Domain
### 快照
[Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)你也可以按需手动执行snapshot命令获取快照,所有参数可以组合使用:
# 默认保存到按时间戳命名的文件
playwright-cli snapshot
# 保存到指定文件,适合工作流结果中使用快照
playwright-cli snapshot --filename=after-click.yaml
# 仅快照指定元素而非整个页面
playwright-cli snapshot "#main"
# 限制快照的深度提升效率,之后可以对指定元素单独快照
playwright-cli snapshot --depth=4
playwright-cli snapshot e34元素定位
默认使用快照中的元素引用(比如e15这种形式)来和页面元素交互。
# 获取带元素引用的快照
playwright-cli snapshot
# 使用元素引用进行交互
playwright-cli click e15你也可以使用css选择器或者Playwright内置选择器:
# css选择器
playwright-cli click "#main > button.submit"
# 角色选择器
playwright-cli click "getByRole('button', { name: 'Submit' })"
# 测试ID选择器
playwright-cli click "getByTestId('submit-button')"浏览器会话
# 创建名为mysession的新浏览器会话,使用持久化配置
playwright-cli -s=mysession open example.com --persistent
# 手动指定配置文件目录(需要时使用)
playwright-cli -s=mysession open example.com --profile=/path/to/profile
playwright-cli -s=mysession click e6
playwright-cli -s=mysession close # 停止指定名称的浏览器会话
playwright-cli -s=mysession delete-data # 删除持久化会话的用户数据
playwright-cli list
# 关闭所有浏览器
playwright-cli close-all
# 强制终止所有浏览器进程
playwright-cli kill-all安装说明
用户系统为linux时,不能用pip安装,优先看包管理器里面有没有,若没有则不安装的告诉用户,npm -g命令必须加sudo否则安装不了。
如果全局playwright-cli命令不可用,可以尝试通过npx使用本地版本:
npx --no-install playwright-cli --version如果本地版本可用,所有命令都可以用npx playwright-cli代替。否则可以全局安装playwright-cli:
npm install -g @playwright/cli@latest示例:表单提交
playwright-cli open https://example.com/form
playwright-cli snapshot
playwright-cli fill e1 "user@example.com"
playwright-cli fill e2 "password123"
playwright-cli click e3
playwright-cli snapshot
playwright-cli close示例:多标签页工作流
playwright-cli open https://example.com
playwright-cli tab-new https://example.com/other
playwright-cli tab-list
playwright-cli tab-select 0
playwright-cli snapshot
playwright-cli close示例:使用开发者工具调试
playwright-cli open https://example.com
playwright-cli click e4
playwright-cli fill e7 "test"
playwright-cli console
playwright-cli network
playwright-cli closeplaywright-cli open https://example.com
playwright-cli tracing-start
playwright-cli click e4
playwright-cli fill e7 "test"
playwright-cli tracing-stop
playwright-cli close特定场景用法
- 运行和调试Playwright测试用例 references/playwright-tests.md
- 请求Mock references/request-mocking.md
- 运行Playwright代码 references/running-code.md
- 浏览器会话管理 references/session-management.md
- 存储状态(Cookie、localStorage) references/storage-state.md
- 测试用例生成 references/test-generation.md
- 链路追踪 references/tracing.md
- 视频录制 references/video-recording.md
- 元素属性检查 references/element-attributes.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

