From 9b6a97d389c3f619505bd5c9b13a830fa9bfa385 Mon Sep 17 00:00:00 2001 From: creatixchu Date: Tue, 20 Oct 2026 15:56:08 +0800 Subject: [PATCH] test(plugins): follow the experimental page for platform assertions --- apps/web/tests/bundle-platform.e2e.ts | 4 +- .../official-unsupported-platform.expected.md | 53 ------------------ ...e-enabled-unsupported-platform.expected.md | 54 ------------------- .../manager-unsupported-platform.expected.md | 54 ------------------- apps/web/tests/plugin-config.e2e.ts | 5 +- apps/web/tests/plugin-manager.e2e.ts | 6 +-- 6 files changed, 7 insertions(+), 169 deletions(-) delete mode 100644 apps/web/tests/expected/plugin-config/official-unsupported-platform.expected.md delete mode 100644 apps/web/tests/expected/plugin-manager/live-enabled-unsupported-platform.expected.md delete mode 100644 apps/web/tests/expected/plugin-manager/manager-unsupported-platform.expected.md diff --git a/apps/web/tests/bundle-platform.e2e.ts b/apps/web/tests/bundle-platform.e2e.ts index 1b23da431a..14c83f72ef 100644 --- a/apps/web/tests/bundle-platform.e2e.ts +++ b/apps/web/tests/bundle-platform.e2e.ts @@ -42,8 +42,10 @@ it('disables unsupported bundles, shows the Host restriction, and refuses direct expect(beforeRuntime).toBeTypeOf('number') expect(scaffold.ctx.ptcRuntime.programFormat).toBe('function-body') const names = [name] + await page.getByRole('button', { name: '更多', exact: true }).click() + const cua = page.locator('[data-plugin-package="@deepseek-ai/dsh-cua-bundle"]') + await cua.waitFor() if (process.platform !== 'darwin') { - const cua = page.locator('[data-plugin-package="@deepseek-ai/dsh-cua-bundle"]') await cua.getByText(reason, { exact: true }).waitFor() expect(await cua.getByRole('switch').isEnabled()).toBe(false) names.push('@deepseek-ai/dsh-cua-bundle') diff --git a/apps/web/tests/expected/plugin-config/official-unsupported-platform.expected.md b/apps/web/tests/expected/plugin-config/official-unsupported-platform.expected.md deleted file mode 100644 index f3f49e709b..0000000000 --- a/apps/web/tests/expected/plugin-config/official-unsupported-platform.expected.md +++ /dev/null @@ -1,53 +0,0 @@ -- heading "插件" [level=1] -- text: 安装、启用和配置插件 -- button "插件说明" -- button "刷新" -- group "添加插件": - - button "添加插件" - - button "选择添加插件方式" -- heading "内置插件配置" [level=3] -- list: - - listitem: - - button "查看 子智能体": 子智能体 - - text: 设置子智能体的递归层级、数量和模型。 - - listitem: - - button "查看 网页搜索": 网页搜索 - - text: 设置 DeepSeek 的搜索提供方。 - - listitem: - - button "查看 Agent 循环": Agent 循环 - - text: 控制 Agent 派发工具调用的方式。 - - listitem: - - button "查看 终端": 终端 - - text: 限制每条命令最多能跑多久、最多输出多少内容。 -- heading "实验性插件" [level=3] -- button "更多" -- list: - - listitem: - - button "查看 智能体团队": 智能体团队 - - text: 实验性 启用团队协作、团队工具、成员列表和共享任务看板。 - - switch "启用 智能体团队" - - listitem: - - button "查看 语音输入": 语音输入 - - text: 实验性 在本机使用 SenseVoice 转写录音,首次使用需安装依赖。 - - switch "启用 语音输入" - - listitem: - - button "查看 自动授权审查": 自动授权审查 - - text: 实验性 提供自动审查权限模式,由模型在每次工具调用前判断是否授权。 - - switch "启用 自动授权审查" - - listitem: - - button "查看 开发者工具": 开发者工具 - - text: 实验性 查看调试会话原始数据、聊天消息分组数据,以及调试 NodeJS 后端 - - switch "启用 开发者工具" - - listitem: - - button "查看 Computer Use": Computer Use - - text: 实验性 异常 目前仅支持 macOS,Windows 支持正在开发中。为已有及新建 PTC 会话加载 Computer Use。请切换到 PTC 模式来使用,并授予辅助功能和屏幕录制权限。 - - switch "启用 Computer Use" [disabled] - - status: 此插件不支持运行 DSH 的主机操作系统 -- heading "已安装插件" [level=3] -- list: - - listitem: - - button "查看 @fixture/live-client": "@fixture/live-client" - - switch "启用 @fixture/live-client" - - listitem: - - button "查看 dsh-web-scaffold-defaults": dsh-web-scaffold-defaults - - switch "启用 dsh-web-scaffold-defaults" [checked] diff --git a/apps/web/tests/expected/plugin-manager/live-enabled-unsupported-platform.expected.md b/apps/web/tests/expected/plugin-manager/live-enabled-unsupported-platform.expected.md deleted file mode 100644 index d3f989f544..0000000000 --- a/apps/web/tests/expected/plugin-manager/live-enabled-unsupported-platform.expected.md +++ /dev/null @@ -1,54 +0,0 @@ -- heading "插件" [level=1] -- text: 安装、启用和配置插件 -- button "插件说明" -- button "刷新" -- group "添加插件": - - button "添加插件" - - button "选择添加插件方式" -- heading "内置插件配置" [level=3] -- list: - - listitem: - - button "查看 子智能体": 子智能体 - - text: 设置子智能体的递归层级、数量和模型。 - - listitem: - - button "查看 网页搜索": 网页搜索 - - text: 设置 DeepSeek 的搜索提供方。 - - listitem: - - button "查看 Agent 循环": Agent 循环 - - text: 控制 Agent 派发工具调用的方式。 - - listitem: - - button "查看 终端": 终端 - - text: 限制每条命令最多能跑多久、最多输出多少内容。 -- heading "实验性插件" [level=3] -- button "更多" -- list: - - listitem: - - button "查看 智能体团队": 智能体团队 - - text: 实验性 启用团队协作、团队工具、成员列表和共享任务看板。 - - switch "启用 智能体团队" - - listitem: - - button "查看 语音输入": 语音输入 - - text: 实验性 在本机使用 SenseVoice 转写录音,首次使用需安装依赖。 - - switch "启用 语音输入" - - listitem: - - button "查看 自动授权审查": 自动授权审查 - - text: 实验性 提供自动审查权限模式,由模型在每次工具调用前判断是否授权。 - - switch "启用 自动授权审查" - - listitem: - - button "查看 开发者工具": 开发者工具 - - text: 实验性 查看调试会话原始数据、聊天消息分组数据,以及调试 NodeJS 后端 - - switch "启用 开发者工具" - - listitem: - - button "查看 Computer Use": Computer Use - - text: 实验性 异常 目前仅支持 macOS,Windows 支持正在开发中。为已有及新建 PTC 会话加载 Computer Use。请切换到 PTC 模式来使用,并授予辅助功能和屏幕录制权限。 - - switch "启用 Computer Use" [disabled] - - status: 此插件不支持运行 DSH 的主机操作系统 -- heading "已安装插件" [level=3] -- list: - - listitem: - - button "查看 @fixture/bundle": "@fixture/bundle" - - text: Registry description for the fixture bundle. - - switch "启用 @fixture/bundle" [checked] - - listitem: - - button "查看 dsh-web-scaffold-defaults": dsh-web-scaffold-defaults - - switch "启用 dsh-web-scaffold-defaults" [checked] diff --git a/apps/web/tests/expected/plugin-manager/manager-unsupported-platform.expected.md b/apps/web/tests/expected/plugin-manager/manager-unsupported-platform.expected.md deleted file mode 100644 index d2df587ad3..0000000000 --- a/apps/web/tests/expected/plugin-manager/manager-unsupported-platform.expected.md +++ /dev/null @@ -1,54 +0,0 @@ -- heading "插件" [level=1] -- text: 安装、启用和配置插件 -- button "插件说明" -- button "刷新" -- group "添加插件": - - button "添加插件" - - button "选择添加插件方式" -- heading "内置插件配置" [level=3] -- list: - - listitem: - - button "查看 子智能体": 子智能体 - - text: 设置子智能体的递归层级、数量和模型。 - - listitem: - - button "查看 网页搜索": 网页搜索 - - text: 设置 DeepSeek 的搜索提供方。 - - listitem: - - button "查看 Agent 循环": Agent 循环 - - text: 控制 Agent 派发工具调用的方式。 - - listitem: - - button "查看 终端": 终端 - - text: 限制每条命令最多能跑多久、最多输出多少内容。 -- heading "实验性插件" [level=3] -- button "更多" -- list: - - listitem: - - button "查看 智能体团队": 智能体团队 - - text: 实验性 启用团队协作、团队工具、成员列表和共享任务看板。 - - switch "启用 智能体团队" - - listitem: - - button "查看 语音输入": 语音输入 - - text: 实验性 在本机使用 SenseVoice 转写录音,首次使用需安装依赖。 - - switch "启用 语音输入" - - listitem: - - button "查看 自动授权审查": 自动授权审查 - - text: 实验性 提供自动审查权限模式,由模型在每次工具调用前判断是否授权。 - - switch "启用 自动授权审查" - - listitem: - - button "查看 开发者工具": 开发者工具 - - text: 实验性 查看调试会话原始数据、聊天消息分组数据,以及调试 NodeJS 后端 - - switch "启用 开发者工具" - - listitem: - - button "查看 Computer Use": Computer Use - - text: 实验性 异常 目前仅支持 macOS,Windows 支持正在开发中。为已有及新建 PTC 会话加载 Computer Use。请切换到 PTC 模式来使用,并授予辅助功能和屏幕录制权限。 - - switch "启用 Computer Use" [disabled] - - status: 此插件不支持运行 DSH 的主机操作系统 -- heading "已安装插件" [level=3] -- list: - - listitem: - - button "查看 @fixture/bundle": "@fixture/bundle" - - text: Registry description for the fixture bundle. - - switch "启用 @fixture/bundle" - - listitem: - - button "查看 dsh-web-scaffold-defaults": dsh-web-scaffold-defaults - - switch "启用 dsh-web-scaffold-defaults" [checked] diff --git a/apps/web/tests/plugin-config.e2e.ts b/apps/web/tests/plugin-config.e2e.ts index 4040b0e072..fabf193a95 100644 --- a/apps/web/tests/plugin-config.e2e.ts +++ b/apps/web/tests/plugin-config.e2e.ts @@ -19,8 +19,7 @@ import { import { ZH_BROWSER_LOCALE, saveFailureShot } from './support.ts' const SNAPSHOT_DIR = fileURLToPath(new URL('./expected/plugin-config', import.meta.url)) -const OFFICIAL_EXPECTED = join(SNAPSHOT_DIR, process.platform === 'darwin' - ? 'official.expected.md' : 'official-unsupported-platform.expected.md') +const OFFICIAL_EXPECTED = join(SNAPSHOT_DIR, 'official.expected.md') const ROW_EXPECTED = join(SNAPSHOT_DIR, 'row.expected.md') const BUNDLE_EXPECTED = join(SNAPSHOT_DIR, 'bundle.expected.md') const FIXTURE_PLUGINS = fileURLToPath(new URL('./fixtures/plugins', import.meta.url)) @@ -441,7 +440,7 @@ describe('web e2e: plugin configuration pages', () => { it.skipIf(MODE === 'record')('keeps the fixture inventory closed', async () => { expect(tripwire.warnings).toEqual([]) - await assertFixtureInventory(SNAPSHOT_DIR, ['bundle.expected.md', 'official.expected.md', 'official-unsupported-platform.expected.md', 'row.expected.md', 'subagent.expected.md', 'web-search.expected.md']) + await assertFixtureInventory(SNAPSHOT_DIR, ['bundle.expected.md', 'official.expected.md', 'row.expected.md', 'subagent.expected.md', 'web-search.expected.md']) }) diff --git a/apps/web/tests/plugin-manager.e2e.ts b/apps/web/tests/plugin-manager.e2e.ts index 7f52301f69..d523b1328b 100644 --- a/apps/web/tests/plugin-manager.e2e.ts +++ b/apps/web/tests/plugin-manager.e2e.ts @@ -21,9 +21,8 @@ import { } from './support.ts' const SNAPSHOT_DIR = fileURLToPath(new URL('./expected/plugin-manager', import.meta.url)) -const PLATFORM_SUFFIX = process.platform === 'darwin' ? '' : '-unsupported-platform' -const MANAGER_EXPECTED = join(SNAPSHOT_DIR, `manager${PLATFORM_SUFFIX}.expected.md`) -const LIVE_EXPECTED = join(SNAPSHOT_DIR, `live-enabled${PLATFORM_SUFFIX}.expected.md`) +const MANAGER_EXPECTED = join(SNAPSHOT_DIR, 'manager.expected.md') +const LIVE_EXPECTED = join(SNAPSHOT_DIR, 'live-enabled.expected.md') const EXPORTS_EXPECTED = join(SNAPSHOT_DIR, 'exports.expected.md') const EXPORTS_EN_EXPECTED = join(SNAPSHOT_DIR, 'exports-en.expected.md') const FIXTURE_PLUGINS = fileURLToPath(new URL('./fixtures/plugins', import.meta.url)) @@ -1136,7 +1135,6 @@ describe('web e2e: plugin manager', () => { await assertFixtureInventory(SNAPSHOT_DIR, [ 'manager.expected.md', 'live-enabled.expected.md', 'missing-bundle.expected.md', 'exports.expected.md', 'exports-en.expected.md', 'icons.expected.md', 'loading.expected.md', 'refresh.expected.md', 'ime-enter.expected.md', 'header-responsive.expected.md', 'preview.expected.md', - 'manager-unsupported-platform.expected.md', 'live-enabled-unsupported-platform.expected.md', ]) }) })