815cbf9d8c
- 更新 .gitignore:全面覆盖环境变量、数据库、日志、缓存、上传文件 - 移除误跟踪的 server/venv/、crm_data.db、.env 文件 - 新增 server/.env.example 模板 - 新增合同管理、利润核算、AI教练等功能模块 - 新增 Playwright e2e 测试套件 - 前后端多项功能升级和 bug 修复
51 lines
1.9 KiB
TypeScript
51 lines
1.9 KiB
TypeScript
/**
|
|
* 系统设置 E2E 测试 (根据真实截图修正)
|
|
* 三个 Tab:
|
|
* - 部门与员工管理
|
|
* - 角色与权限控制 (RBAC)
|
|
* - 企业账号配置
|
|
*/
|
|
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('系统设置', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto('/settings');
|
|
await page.waitForLoadState('networkidle');
|
|
});
|
|
|
|
test('设置页面正确加载', async ({ page }) => {
|
|
// 三个 Tab 标题
|
|
await expect(page.getByText('部门与员工管理')).toBeVisible({ timeout: 5000 });
|
|
await expect(page.getByText('角色与权限控制')).toBeVisible();
|
|
await expect(page.getByText('企业账号配置')).toBeVisible();
|
|
});
|
|
|
|
test('部门与员工管理 tab 内容', async ({ page }) => {
|
|
const deptTab = page.getByText('部门与员工管理').first();
|
|
await deptTab.click();
|
|
await page.waitForTimeout(1000);
|
|
// 应显示部门树或员工列表
|
|
await expect(page.locator('body')).toContainText(/部门|员工/, { timeout: 3000 });
|
|
});
|
|
|
|
test('角色与权限控制 tab', async ({ page }) => {
|
|
await page.getByText('角色与权限控制').first().click();
|
|
await page.waitForTimeout(1500);
|
|
// 左侧应有角色列表区域
|
|
await expect(page.getByText('平台运营角色')).toBeVisible({ timeout: 5000 });
|
|
await expect(page.getByText('新增角色')).toBeVisible();
|
|
});
|
|
|
|
test('新增角色按钮', async ({ page }) => {
|
|
await page.getByText('角色与权限控制').first().click();
|
|
await page.waitForTimeout(1000);
|
|
await expect(page.getByText('新增角色')).toBeVisible({ timeout: 3000 });
|
|
});
|
|
|
|
test('企业账号配置 tab', async ({ page }) => {
|
|
await page.getByText('企业账号配置').first().click();
|
|
await page.waitForTimeout(1000);
|
|
await expect(page.locator('body')).toContainText(/企业|账号/, { timeout: 3000 });
|
|
});
|
|
});
|