cherry-regression-test
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCherry Regression Test
Cherry 回归测试
Run deterministic Playwright E2E tests against one driver-owned Cherry Studio
process per platform. The tested product includes Chat, Agents, MCP, Skills,
knowledge bases, translation, image generation, and code tools; an LLM test
agent does not control the test run.
在每个平台上,针对一个由回归测试 driver 管理的 Cherry Studio
进程运行确定性的 Playwright E2E 测试。被测产品包括 Chat、Agents、MCP、Skills、
知识库、翻译、图像生成和代码工具;LLM 测试
Agent 不控制测试执行。
CI contract
CI 契约
Use as the entry point. It:
.github/workflows/e2e-regression-test.yml- Resolves a trusted branch or release tag.
- Initializes an isolated directory under the GitHub runner temporary folder.
- Installs the application and the code tools under test.
- Launches one owned Electron process with CDP enabled.
- Runs in the manifest's phase order.
tests/e2e/regression/phases/*.test.ts - Continues after a failed phase so later results are still collected.
- Produces English platform and aggregate reports, then enforces the verdict.
- Stops only the Electron process recorded in the isolated run directory.
Do not add an LLM tool loop, MCP control server, turn limit, or a second
Electron launch for each test. A restart is allowed only where the case contract
explicitly verifies persistence or switches from the clean startup profile to
the authenticated shared profile.
使用 作为入口。它:
.github/workflows/e2e-regression-test.yml- 确定一个受信任的分支或发布标签。
- 在 GitHub runner 的临时文件夹下初始化一个隔离目录。
- 安装被测应用和代码工具。
- 启动一个由该 driver 管理的 Electron 进程,并启用 CDP。
- 按 manifest 中的阶段顺序运行 。
tests/e2e/regression/phases/*.test.ts - 阶段失败后仍继续执行,以便收集后续结果。
- 生成英文的平台报告和汇总报告,然后据此执行最终判定。
- 仅停止隔离运行目录中记录的 Electron 进程。
不要添加 LLM 工具循环、MCP 控制服务器、轮次限制,也不要为每个测试进行第二次
Electron 启动。仅当用例契约明确验证持久化,或从全新启动 profile 切换到
已认证的共享 profile 时,才允许重启。
Configuration
配置
The workflow reads these repository variables and secrets:
CHERRY_TEST_CUSTOM_PROVIDER_BASE_URLCHERRY_TEST_CUSTOM_PROVIDER_ANTHROPIC_BASE_URLCHERRY_TEST_CUSTOM_PROVIDER_API_KEYCHERRY_TEST_CUSTOM_PROVIDER_CHAT_MODELCHERRY_TEST_CUSTOM_PROVIDER_EMBEDDING_BASE_URLCHERRY_TEST_CUSTOM_PROVIDER_EMBEDDING_API_KEYCHERRY_TEST_CUSTOM_PROVIDER_EMBEDDING_MODELCHERRY_TEST_CHERRYIN_CHAT_MODELCHERRY_TEST_CHERRYIN_IMAGE_MODELCHERRY_TEST_CHERRYIN_ACCOUNTCHERRY_TEST_CHERRYIN_PASSWORD
The custom chat provider requires both URLs:
fills OpenAI, and fills Anthropic.
Both endpoints share .
CHERRY_TEST_CUSTOM_PROVIDER_BASE_URLCHERRY_TEST_CUSTOM_PROVIDER_ANTHROPIC_BASE_URLCHERRY_TEST_CUSTOM_PROVIDER_API_KEYChat and embedding providers are independent. Never print literal credentials,
write them to fixtures, attach them to Playwright artifacts, or pass them to an
unrelated action.
工作流读取以下仓库变量和 secrets:
CHERRY_TEST_CUSTOM_PROVIDER_BASE_URLCHERRY_TEST_CUSTOM_PROVIDER_ANTHROPIC_BASE_URLCHERRY_TEST_CUSTOM_PROVIDER_API_KEYCHERRY_TEST_CUSTOM_PROVIDER_CHAT_MODELCHERRY_TEST_CUSTOM_PROVIDER_EMBEDDING_BASE_URLCHERRY_TEST_CUSTOM_PROVIDER_EMBEDDING_API_KEYCHERRY_TEST_CUSTOM_PROVIDER_EMBEDDING_MODELCHERRY_TEST_CHERRYIN_CHAT_MODELCHERRY_TEST_CHERRYIN_IMAGE_MODELCHERRY_TEST_CHERRYIN_ACCOUNTCHERRY_TEST_CHERRYIN_PASSWORD
自定义聊天 provider 必须同时提供两个 URL:
用于填充 OpenAI 配置, 用于填充 Anthropic 配置。
两个 endpoint 共用 。
CHERRY_TEST_CUSTOM_PROVIDER_BASE_URLCHERRY_TEST_CUSTOM_PROVIDER_ANTHROPIC_BASE_URLCHERRY_TEST_CUSTOM_PROVIDER_API_KEYChat 和 embedding provider 相互独立。绝不打印明文凭据、将其写入 fixtures、
将其附加到 Playwright artifacts,或传递给无关 action。
Test organization
测试组织
Read scenario organization and the
controller contract before making changes.
Register each case from the manifest:
ts
test(...caseDefinition('S-01'), async ({ mainWindow }) => {
// Assert the user-visible outcome.
})cases.tssystemAutomation.tsRecord assertions in Playwright, not prose. The custom reporter writes case and phase
status into and feeds the English Markdown/JUnit reports. The fixture
saves failure screenshots. Executor errors and interrupted phases block a passing verdict. Do not enable Playwright Trace for credential-bearing
tests because action parameters can expose secrets. A passing result does not
depend on a model's judgment.
run.json修改前,请阅读 场景组织 和
控制器契约。
在 manifest 中注册每个用例:
ts
test(...caseDefinition('S-01'), async ({ mainWindow }) => {
// Assert the user-visible outcome.
})cases.tssystemAutomation.ts在 Playwright 中记录断言,而不是用文字描述。自定义 reporter 将用例和阶段状态写入
,并为英文 Markdown/JUnit 报告提供数据。fixture 会保存失败截图。Executor 错误和
中断的阶段都会阻止通过判定。对于包含凭据的测试,不要启用 Playwright Trace,因为
action 参数可能暴露 secrets。是否通过不依赖模型的判断。
run.jsonFocused execution
定向执行
With an initialized run directory and its owned Electron process running:
bash
pnpm exec tsx scripts/e2e/regression/cli.ts run-phase \
--run-dir /absolute/run-directory --phase basicFeaturesThe task selected when initializing the run determines which cases execute.
For a Notes-only run, initialize with . Enumeration is read-only:
set to an absolute path, but no initialized run directory
or running Electron process is required because does not execute fixtures.
--task notesCHERRY_TEST_RUN_DIR--listbash
CHERRY_TEST_RUN_DIR=/tmp/cherry-regression-list pnpm test:e2e:regression --listDo not call the regression cleanup command for an Electron instance owned by
; cleanup is only for an app record created by this driver.
cherry-electron-dev在已初始化的运行目录及其管理的 Electron 进程正在运行时:
bash
pnpm exec tsx scripts/e2e/regression/cli.ts run-phase \
--run-dir /absolute/run-directory --phase basicFeatures初始化 run 时选定的 task 决定执行哪些用例。对于仅运行 Notes 的场景,初始化时使用
。用例枚举是只读操作:将 设置为绝对路径,但由于
不会执行 fixtures,因此无需初始化运行目录,也无需运行中的 Electron 进程。
--task notesCHERRY_TEST_RUN_DIR--listbash
CHERRY_TEST_RUN_DIR=/tmp/cherry-regression-list pnpm test:e2e:regression --list不要对 所拥有的 Electron 实例调用回归清理命令;清理操作仅适用于由本 driver 创建的应用记录。
cherry-electron-devVerification when changing the framework
修改框架时的验证
Run the focused script suite and enumerate Playwright cases:
bash
pnpm exec vitest run --project scripts scripts/e2e/regression
CHERRY_TEST_RUN_DIR=/tmp/cherry-regression-list \
pnpm test:e2e:regression --list
pnpm typecheck:e2e
pnpm test:lintDo not use or for this focused workflow change.
pnpm testpnpm build:check运行定向脚本测试套件并枚举 Playwright 用例:
bash
pnpm exec vitest run --project scripts scripts/e2e/regression
CHERRY_TEST_RUN_DIR=/tmp/cherry-regression-list \
pnpm test:e2e:regression --list
pnpm typecheck:e2e
pnpm test:lint对于此次定向工作流变更,不要使用 或 。
pnpm testpnpm build:check