playwright-triage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePlaywright CLI Issue Triage
Playwright CLI Issue 分类诊断
You run unattended in the Issue triage workflow of
. First read the shared guide, , a copy of
microsoft/playwright/.github/actions/run-agent/guides/triage.md,
and then CLAUDE.md, both in full. The guide says how to triage an issue in any
Playwright repo. CLAUDE.md says how to build, test and lint this one. This file covers what neither
has: where the code is, the checkouts, how to run a published version, and the outcome that this
repo adds, a fix in .
microsoft/playwright-cli$AGENT_GUIDES_DIR/triage.mdmicrosoft/playwright你会在 的 Issue triage 工作流中无人值守地运行。首先完整阅读共享指南 (它是 microsoft/playwright/.github/actions/run-agent/guides/triage.md 的副本),然后完整阅读 CLAUDE.md。该指南介绍了如何在任何 Playwright 仓库中对 issue 进行分类诊断。CLAUDE.md 介绍了如何构建、测试和 lint 本仓库。本文件则补充前两者未涵盖的内容:代码位置、各 checkout、如何运行已发布版本,以及本仓库额外产生的结果——在 中进行修复。
microsoft/playwright-cli$AGENT_GUIDES_DIR/triage.mdmicrosoft/playwrightWhere the code is
代码位置
This repo is the npm package : with its update check,
, the README, the skill in and some tests of the packaged
CLI. pins the alpha of and that the package runs. The
CLI is in , in : has the
commands and their options, has the daemon that keeps the browser open between
commands, and has the tools that the commands run. Most bugs and most feature requests
are fixed there.
@playwright/cliplaywright-cli.jsskillCheck.jsskills/playwright-cli/package.jsonplaywrightplaywright-coremicrosoft/playwrightpackages/playwright-core/src/tools/cli-client/cli-daemon/backend/Fix a bug here only when the cause is in a file that this repo owns. is a
copy of , which
refreshes on a roll, so its fix is upstream too.
skills/playwright-cli/packages/playwright-core/src/tools/skills/playwright-cli/scripts/update.js本仓库是 npm 包 :包括带有更新检查逻辑的 、、README、位于 的 skill,以及该打包 CLI 的一些测试。 锁定了该包运行时使用的 和 alpha 版本。
@playwright/cliplaywright-cli.jsskillCheck.jsskills/playwright-cli/package.jsonplaywrightplaywright-coreCLI 位于 的 中: 包含命令及其选项, 包含在命令之间保持浏览器打开的 daemon, 包含命令运行所调用的工具。大多数 bug 和大多数功能请求都在那里修复。
microsoft/playwrightpackages/playwright-core/src/tools/cli-client/cli-daemon/backend/只有当问题原因位于本仓库负责的文件中时,才应在这里修复 bug。 是 的副本,后者会在 roll 时由 刷新,因此对前者的修复同样属于上游修复。
skills/playwright-cli/packages/playwright-core/src/tools/skills/playwright-cli/scripts/update.jsThe checkouts
各 checkout
$REPO_DIRmicrosoft/playwright-clinpm cinpx playwright install chromegit fetch --unshallow --tags origin$PLAYWRIGHT_DIRmicrosoft/playwrightmain$REPO_DIRnpm cinpm run buildtests/mcp/cli-*.spec.tsclitests/mcp/cli-fixtures.tsnpm run test-playwright-cliAGENTS.mdgit loggit tag --containsThe pinned version is older than tip-of-tree. prints the
upstream commit that an alpha was built from.
npm view playwright-core@<alpha> gitHead$REPO_DIRmicrosoft/playwright-clinpm cinpx playwright install chromegit fetch --unshallow --tags origin$PLAYWRIGHT_DIR$REPO_DIRmicrosoft/playwrightmainnpm cinpm run buildtests/mcp/cli-*.spec.tstests/mcp/cli-fixtures.tsclinpm run test-playwright-cliAGENTS.mdgit loggit tag --contains锁定版本比 tip-of-tree 更旧。 会输出构建某个 alpha 所对应的上游提交。
npm view playwright-core@<alpha> gitHeadFix in microsoft/playwright
在 microsoft/playwright 中修复
When the fix is in , follow the Fix section of the guide there, in place of
: create the branch from in , put the regression test
in its , build and lint as its says, and commit in its
convention, for example . Then leave the proposal in in
place of , with the same files:
$PLAYWRIGHT_DIR$REPO_DIRfix-<n>main$PLAYWRIGHT_DIRtests/mcp/cli-*.spec.tsAGENTS.mdfix(cli): ...$OUTPUT_DIR/upstream-fix/$OUTPUT_DIR/fix/- : the output of
fix.patchingit diff --binary main HEAD.$PLAYWRIGHT_DIR - : as the guide says. The
pr-body.mdline has the full URL of the issue,Fixes, so that the PR closes the issue in this repo.Fixes https://github.com/microsoft/playwright-cli/issues/<n> - : as the guide says. Write it last.
proposal.json
The publish job opens the draft PR in . The revision workflow of that repo
addresses the review. Leave one proposal: or , not both. Do not change
here to pick up the fix. It reaches with the next roll.
microsoft/playwrightfix/upstream-fix/package.json@playwright/cliCheck the linked PRs in both repos. A PR in links this issue with its
full URL or as . Search there too:
and
. A PR there from the team or from
is a team PR. Verify a PR there in .
microsoft/playwrightmicrosoft/playwright-cli#<n>repo:microsoft/playwright is:pr "playwright-cli/issues/<n>"repo:microsoft/playwright is:pr "playwright-cli#<n>"microsoft-playwright-automation$PLAYWRIGHT_DIRAlready fixed means that tip-of-tree passes and the pinned version fails. The fix reaches users
with the next roll. Find the upstream PR with
,
and name it in the note.
git -C $PLAYWRIGHT_DIR log <gitHead of the pinned alpha>..main -- packages/playwright-core/src/tools当修复位于 时,请遵循指南中的 Fix 一节,并使用 替代 :在 中基于 创建分支 ,将回归测试放入其 中,按照其 的说明进行构建和 lint,并按照其约定提交,例如 。
$PLAYWRIGHT_DIR$PLAYWRIGHT_DIR$REPO_DIR$PLAYWRIGHT_DIRmainfix-<n>tests/mcp/cli-*.spec.tsAGENTS.mdfix(cli): ...然后将提案留在 中,以替代 ,并包含以下相同文件:
$OUTPUT_DIR/upstream-fix/$OUTPUT_DIR/fix/- :在
fix.patch中执行$PLAYWRIGHT_DIR的输出。git diff --binary main HEAD - :按照指南所述编写。
pr-body.md行应包含 issue 的完整 URL,即Fixes,以便 PR 关闭本仓库中的该 issue。Fixes https://github.com/microsoft/playwright-cli/issues/<n> - :按照指南所述编写。最后再写入此文件。
proposal.json
发布作业会在 中创建 draft PR。该仓库的 revision 工作流会处理评审意见。只留下一个提案目录: 或 ,不要两者都留。不要修改此处的 来引入该修复;它会在下一次 roll 中进入 。
microsoft/playwrightfix/upstream-fix/package.json@playwright/cli检查两个仓库中关联的 PR。 中的 PR 可能通过完整 URL 或 关联此 issue。也要在那里搜索:
和
。
来自团队或 的 PR 属于团队 PR。应在 中验证该处的 PR。
microsoft/playwrightmicrosoft/playwright-cli#<n>repo:microsoft/playwright is:pr "playwright-cli/issues/<n>"repo:microsoft/playwright is:pr "playwright-cli#<n>"microsoft-playwright-automation$PLAYWRIGHT_DIR已经修复是指 tip-of-tree 测试通过,而锁定版本测试失败。该修复会在下一次 roll 中交付给用户。使用以下命令查找上游 PR,并在说明中注明它:
git -C $PLAYWRIGHT_DIR log <gitHead of the pinned alpha>..main -- packages/playwright-core/src/toolsPublished versions
已发布版本
To run a published version, for example the version of the reporter or to bisect, create
and run there:
$SCRATCH_DIR/playwright-cli-<n>/<version>/bash
npm init -y
npm i @playwright/cli@<version>
npx playwright-cli --helpThe fixtures of the repo are not available there. Run the condensed repro as
commands, or as a script that spawns them, in that directory. Serve the page from a URL or
from in the script. Run when you are done, so
that no daemon stays open.
npx playwright-clidata:http.createServer()npx playwright-cli close-allnpm view @playwright/cli@<version> dependencies.playwright-coregit -C $PLAYWRIGHT_DIR log <good gitHead>..<bad gitHead> -- packages/playwright-core/src/tools要运行已发布版本,例如运行 reporter 的某个版本或用于 bisect,请创建 并在其中运行:
$SCRATCH_DIR/playwright-cli-<n>/<version>/bash
npm init -y
npm i @playwright/cli@<version>
npx playwright-cli --help仓库的 fixture 在那里不可用。请在该目录中将精简后的复现步骤作为 命令运行,或编写脚本启动这些命令。通过 URL 提供页面,或在脚本中使用 。完成后运行 ,确保没有 daemon 保持打开。
npx playwright-clidata:http.createServer()npx playwright-cli close-allnpm view @playwright/cli@<version> dependencies.playwright-coregit -C $PLAYWRIGHT_DIR log <good gitHead>..<bad gitHead> -- packages/playwright-core/src/toolsPRs from third parties
第三方 PR
Do not run a PR in this repo that changes , , ,
, or . For a PR in , the list in
applies.
package.jsonpackage-lock.jsonscripts/.github/.azure-pipelines/.claude/microsoft/playwright$PLAYWRIGHT_DIR/.claude/skills/playwright-triage/SKILL.md如果本仓库中的 PR 修改了 、、、、 或 ,不要运行它。对于 中的 PR,适用 中的列表。
package.jsonpackage-lock.jsonscripts/.github/.azure-pipelines/.claude/microsoft/playwright$PLAYWRIGHT_DIR/.claude/skills/playwright-triage/SKILL.md