mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 09:55:56 +08:00
test: 新增 4 条 E2E 测试 — 启动加载、CRUD撤销、禁用保存、搜索清理
This commit is contained in:
@@ -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);
|
||||
});
|
||||
Reference in New Issue
Block a user