SuperAPI AI 工具集

playwright-cli

测试与质量

查看项目

更新于 10-16 09:33

技能介绍

用途:在终端通过 npx playwright 使用 Playwright 的 CLI 能力,包括运行 E2E 测试、用 codegen 录制生成测试代码、对 URL 做一次性截图或 PDF,以及 CI 分片运行。

主要能力与用法: 交互式 codegen:npx playwright codegen https://example.com 运行全部测试:npx playwright test;运行指定文件:npx playwright test tests/login.spec.ts;按标题运行:npx playwright test -g "should login" 调试:npx playwright test --debug;UI 模式:npx playwright test --ui;有头模式:npx playwright test --headed 指定浏览器:npx playwright test --project=chromium;生成 trace:npx playwright test --trace on;查看报告:npx playwright show-report 安装浏览器:npx playwright install;CI 优化安装:npx playwright install chromium --with-deps CI 分片:npx playwright test --shard=1/3(2/3、3/3 同理) 截图:npx playwright screenshot --browser=chromium https://example.com screenshot.png PDF(仅 Chromium):npx playwright pdf https://example.com page.pdf

边界与限制:本技能只覆盖 CLI 界面。编写、审查或调优 Playwright 测试套件属于 playwright-test 技能;由智能体驱动的实时浏览器控制(导航→点击→读取→断言)使用 mcp__claude-in-chrome__* 工具;交互式数据抓取或 SPA 探索可用 claude-in-chrome MCP 工具,或编写 tests/*.spec.ts 后执行 npx playwright test。PDF 仅支持 Chromium。其他收费、价格或平台信息暂未提供。