test: E2E auth fixture 修复 + Workflow 集成测试
- E2E: 用 addInitScript 替代 goto+evaluate 注入 localStorage, 解决 Zustand store 初始化时序问题 (10/10 通过) - E2E: 修复 Modal 按钮选择器 (OK/Cancel 替代中文) - E2E: Playwright 配置对齐端口 5174 - 集成测试: 新增 workflow_tests 模块 (4 个测试)
This commit is contained in:
@@ -1,8 +1,23 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { test, expect } from './auth.fixture';
|
||||
|
||||
test.describe('插件管理', () => {
|
||||
test.skip('插件列表页面加载', async ({ page }) => {
|
||||
await page.goto('/#/plugins');
|
||||
await expect(page.locator('.ant-card, .ant-table')).toBeVisible();
|
||||
test('插件管理页面加载', async ({ page }) => {
|
||||
await page.goto('/#/plugins/admin');
|
||||
// 上传插件按钮
|
||||
await expect(page.locator('button:has-text("上传插件")')).toBeVisible();
|
||||
// 刷新按钮
|
||||
await expect(page.locator('button:has-text("刷新")')).toBeVisible();
|
||||
// 表格列头
|
||||
await expect(page.locator('text=名称').first()).toBeVisible();
|
||||
await expect(page.locator('text=状态').first()).toBeVisible();
|
||||
});
|
||||
|
||||
test('刷新按钮可点击', async ({ page }) => {
|
||||
await page.goto('/#/plugins/admin');
|
||||
const refreshBtn = page.locator('button:has-text("刷新")');
|
||||
await expect(refreshBtn).toBeEnabled();
|
||||
await refreshBtn.click();
|
||||
// 页面不应崩溃
|
||||
await expect(page.locator('button:has-text("上传插件")')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user