🎁 福利专区全网大模型免费应用 + 新用户福利 + 注册活动入口,低成本玩转 AI

Playwright 测试台 mitao-su/dsh-playwright-cli

DeepSeek Harness
mitao-su82 天前有提交已提供中文文档扫描:含敏感能力

在会话里安装浏览器、跑测试并打开报告

33/100
综合分
2
GitHub 星标
—
npm 周下载
—/5
用户评分

数据截至 2026/9/18 · 周下载取自 npm 全网(含 CI / 镜像),非本站安装数;综合分由星标、活跃度与兼容性检查合成。

自动兼容检查有告警:未发布到 npm registry,仅可从源码安装。
安装命令 · 需先装 dsh CLI 引擎
dsh plugin --profile web add mitao-su/dsh-playwright-cli
该包不可直接 npm 安装,改从 GitHub 源安装(明细见下方安装检查)

状态速览

判定依据:实装验证 · 静态安装检查 · 自动扫描 · 仓库维护状态
信任档位:需留意
是什么
dsh 原生插件 · market
装得上吗
实装验证未通过(dependency_conflict),装前请到仓库确认最近更新与 issue
L4 · 真实安装等级说明 →
安全吗
本站尚未对该插件做风险分级
暂未覆盖,不等同于无风险
还在维护吗
更新放缓:最近一次提交在 82 天前
档位由哪些信号合成

本站实装验证(真实安装 L4 覆盖全站;L5 为运行时冒烟或实机截图,覆盖范围小于 L4) · 验证所用 dsh 版本 · 静态安装检查 · 风险分级 · 仓库维护状态。 下方各区块是它的证据明细。

验证判据与等级说明 →
⚠︎ 实装验证未通过(dependency_conflict · 2026/10/27) ——可能是验证环境差异,装前建议到 GitHub 仓库确认最近更新与 issue。
社区实装还没有人打卡 · 装过的第一个就是你
安装兼容性检查⚠ 装前注意

未发布到 npm registry,仅可从源码安装

展开查看检查明细 ↓

以下结论由程序自动检查 npm 包、engines 声明与入口文件得出,未做人工实机验证——能装不等于用着没问题。

✗npm 包dsh-playwright-cli(未发布到 npm,仅可源码安装)
✓Node 引擎未声明 engines.node
✓dsh CLI 依赖未声明 dsh 版本约束
✓入口文件main/exports/bin 已声明

验证方式:npm registry 存在性 + package.json 静态校验 · 最后检查 2026/10/17 12:40:15

安全扫描自动 · 静态分析源码
v2.7.0
🔵 扫描:含敏感能力尚无人工评估
展开查看扫描说明与证据 ↓

静态扫描发现插件具备触达本地系统的能力:执行外部命令、读写/删除本地文件、读取剪贴板或密钥类环境变量(至少其一)。这是能力清单,不是危险判定——具体能力项与证据见下方,安装前请自行判断是否需要。

读写/删除本地文件
查看扫描证据(共 4 处,展示前 4 条)
  • 读取本地文件
    lib/index.js:233
    if (!existsSync(filePath) || !statSync(filePath).isFile()) {
  • 读取本地文件
    lib/index.js:233
    if (!existsSync(filePath) || !statSync(filePath).isFile()) {
  • 读取本地文件
    lib/index.js:243
    const stream = createReadStream(filePath);
  • 读取本地文件
    lib/index.js:552
    if (!existsSync(indexHtml)) {
扫描于 2026/11/4(0 天前) · 范围 入口闭包 + 发布文件清单 · 来源 GitHub 仓库

静态扫描只反映源码中出现的调用,不构成安全背书;人工评估与自动扫描相互独立、互不覆盖。

依赖的 DSH / Cordis 模块
@deepseek-ai/cordis@deepseek-ai/dsh-agent@deepseek-ai/dsh-host-webserver@deepseek-ai/dsh-llm@deepseek-ai/dsh-sandbox@deepseek-ai/dsh-sandbox-policy@deepseek-ai/dsh-shell@deepseek-ai/dsh-tools@deepseek-ai/dsh-user-approval@deepseek-ai/schemastery
给这个插件打分还没有人投票↓
用户评分
还没有人投票,来当第一个

功能亮点

  • 安装浏览器
  • 运行测试
  • 打开HTML报告

README

由 DeepSeek 最新模型翻译生成
dsh-playwright-cli DeepSeek Harness(DSH)host 插件:把 Playwright CLI 封装成 Agent 可一键调用的工具集 —— 探测版本、安装浏览器、跑测试、打开 HTML 报告,全程无需手敲 npx playwright ...。 - 运行面:host-only(无 client bundle,无 Web 依赖)。 - 执行缝:复用官方 shell 执行器(ctx.shell,与 bash/pwsh 工具同源),因此 sandbox 策略、DSH_* 环境变量、输出截断、超时/中止分类全部由组合提供。 - 分发:lib/ 已提交进 Git,安装不触发任何构建脚本,零交互。
展开完整文档(README 剩余 1 节)
dsh-playwright-cli

DeepSeek Harness(DSH)host 插件:把 Playwright CLI 封装成 Agent 可一键调用的工具集 —— 探测版本、安装浏览器、跑测试、打开 HTML 报告,全程无需手敲 npx playwright ...。

- 运行面:host-only(无 client bundle,无 Web 依赖)。
- 执行缝:复用官方 shell 执行器(ctx.shell,与 bash/pwsh 工具同源),因此 sandbox 策略、DSH_* 环境变量、输出截断、超时/中止分类全部由组合提供。
- 分发:lib/ 已提交进 Git,安装不触发任何构建脚本,零交互。

工具

| 工具 | 作用 | 底层命令 |
| playwright_version | 探测目标项目里 CLI 是否可用并打印版本 | npx --no-install playwright --version |
| playwright_install | 安装浏览器(默认 chromium);CLI 缺失且 autoInstallPackage 开启时先用 npm 脚手架 @playwright/test | npx --no-install playwright install [browsers...] |
| playwright_test | 运行测试套件,支持 --config/--project/--grep/--workers/--reporter/--headed/--trace/--retries/--list 等常用选项 | npx --no-install playwright test ... |
| playwright_show_report | 定位 HTML 报告:有 web server 时注册回环路由并返回 URL;否则返回文件绝对路径 | playwright-report/index.html 静态服务 |

所有命令默认在会话工作区(session cwd)中执行,非零退出报告而非报错,由模型自行判断下一步。

安装

要求:目标 profile 已挂载 shell 执行器(标准 web/headless 组合自带;DSH ≥ 0.1.0-rc.6)。

dsh plugin --profile web add github:mitao-su/dsh-playwright-cli

走 Git 分发:本仓库把构建产物 lib/ 提交进 Git,pnpm 不会执行任何 prepare 脚本,因此无需配置 allowBuilds。安装成功后重启目标 profile(dsh plugin 会自动把包加入 dsh.profile.bundles)。

受限网络备选(github: 依赖需要本机 git 可访问 GitHub):也可直接用 GitHub tarball URL 安装,效果相同:

dsh plugin --profile web add https://github.com/mitao-su/dsh-playwright-cli/archive/refs/heads/main.tar.gz

本地路径/开发安装:

dsh plugin --profile web add ./dsh-playwright-cli # 或 file: 前缀

使用示例

Agent 侧一次典型会话:

1. playwright_version(workdir 默认会话工作区)→ 确认 CLI 就绪;
2. playwright_test(files: ["tests/login.spec.ts"],reporter: "html")→ 跑测试,得到 reportDir;
3. playwright_show_report → 拿到 url,用户直接在浏览器打开报告。

配置(profile cordis.patch.yml 按 id: playwright-cli 整段覆盖):

- insert:
- id: playwright-cli
name: dsh-playwright-cli
config:
timeoutMs: 600000 # 每次 CLI 调用的默认超时 reportDir: playwright-report reportRoute: /playwright-report autoInstallPackage: true # CLI 缺失时自动 npm install -D @playwright/test

注意事项

- 沙箱与升级出口:命令走 shell 执行器的 sandbox。浏览器二进制下载到用户目录、playwright test fork worker 子进程等,都可能被文件沙箱拒绝——此时结果带 [sandbox: file access denied ...] 标记和升级提示。playwright_version / playwright_install / playwright_test 与官方 shell 工具一致,提供 sandbox_permissions + justification 参数:沙箱拒绝后,用能通过的最窄更宽模式重试同一条命令(如 danger-full-access),执行前会弹用户审批,获批后仅本次调用生效。
- 本地安装约束(避免双副本):工具按 npx --no-install 解析,只认 workdir 里的本地 @playwright/test,不会用全局 CLI。若 workdir 的 spec 文件 require('@playwright/test') 解析到本地副本而 CLI 命中全局,会出现 test.describe() not expected here 之类的双副本错误——请把 workdir 指向装有本地 @playwright/test 的项目目录(可先用 playwright_install 脚手架)。
- 引号:参数按挂载 shell 的方言(bash/pwsh)自动安全引用;含单引号的路径请先重命名。
- 报告路由:playwright_show_report 每次调用注册一条 /playwright-report/ 回环路由,插件卸载时统一释放;同一报告可多次调用。
- 并发:playwright_test/playwright_install 声明为不可并发(共享 test-results/report 目录)。

开发

pnpm install
pnpm verify # typecheck + build + git diff --check

License

MIT
预览分享卡片长什么样 ↓mitao-su/dsh-playwright-cli
分享 · DeepSeek Harness Hub
mitao-su/dsh-playwright-cli

在会话里安装浏览器、跑测试并打开报告

这是你的仓库?认领条目

回到顶部