Files
erp/apps/web/e2e/tenant-isolation.spec.ts
iven 790991f77c
Some checks are pending
CI / rust-check (push) Waiting to run
CI / rust-test (push) Waiting to run
CI / frontend-build (push) Waiting to run
CI / security-audit (push) Waiting to run
test: E2E auth fixture 修复 + Workflow 集成测试
- E2E: 用 addInitScript 替代 goto+evaluate 注入 localStorage,
  解决 Zustand store 初始化时序问题 (10/10 通过)
- E2E: 修复 Modal 按钮选择器 (OK/Cancel 替代中文)
- E2E: Playwright 配置对齐端口 5174
- 集成测试: 新增 workflow_tests 模块 (4 个测试)
2026-04-18 08:40:33 +08:00

36 lines
1.2 KiB
TypeScript

import { test, expect } from './auth.fixture';
test.describe('多租户隔离', () => {
test('侧边栏按模块分组显示', async ({ page }) => {
await page.goto('/#/');
// 验证侧边栏模块分组
await expect(page.locator('text=基础模块').first()).toBeVisible();
await expect(page.locator('text=业务模块').first()).toBeVisible();
await expect(page.locator('text=系统').first()).toBeVisible();
// 验证关键菜单项
await expect(page.locator('text=工作台').first()).toBeVisible();
await expect(page.locator('text=用户管理').first()).toBeVisible();
});
test('顶部导航栏显示用户信息', async ({ page }) => {
await page.goto('/#/');
// 验证顶部导航栏元素
await expect(page.locator('text=系统管理员').first()).toBeVisible();
});
test('页面间导航正常工作', async ({ page }) => {
await page.goto('/#/');
// 点击用户管理
await page.locator('text=用户管理').first().click();
await expect(page).toHaveURL(/#\/users/);
// 点击工作台返回
await page.locator('text=工作台').first().click();
await expect(page).toHaveURL(/#\/$/);
});
});