test: 新增 4 条 E2E 测试 — 启动加载、CRUD撤销、禁用保存、搜索清理

This commit is contained in:
2026-05-27 14:16:24 +08:00
parent ff343185c9
commit 45e2a4e584
5 changed files with 122 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import { test, expect } from '@playwright/test';
import { createIpcMock } from '../mocks/ipc';
test.beforeEach(async ({ page }) => {
await page.addInitScript(createIpcMock());
await page.goto('/');
});
test('启动后加载系统 PATH 和用户 PATH', async ({ page }) => {
// 系统 tab 默认激活,显示 2 条路径
await expect(page.locator('table tbody tr')).toHaveCount(2);
// 切换到用户 tab
await page.click('text=用户变量');
await page.waitForTimeout(300);
await expect(page.locator('table tbody tr')).toHaveCount(1);
});