815cbf9d8c
- 更新 .gitignore:全面覆盖环境变量、数据库、日志、缓存、上传文件 - 移除误跟踪的 server/venv/、crm_data.db、.env 文件 - 新增 server/.env.example 模板 - 新增合同管理、利润核算、AI教练等功能模块 - 新增 Playwright e2e 测试套件 - 前后端多项功能升级和 bug 修复
38 lines
1.5 KiB
TypeScript
38 lines
1.5 KiB
TypeScript
/**
|
|
* 业务闭环 E2E 测试 (v4)
|
|
*/
|
|
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe.serial('业务闭环: 客户 → 订单 → 发货', () => {
|
|
test('Step 1: 新增客户', async ({ page }) => {
|
|
await page.goto('/customers');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
await page.getByRole('button', { name: '新增客户' }).click();
|
|
await expect(page.locator('.el-dialog')).toBeVisible({ timeout: 3000 });
|
|
|
|
await page.getByPlaceholder('请输入客户公司名称').fill(`闭环_${Date.now()}`);
|
|
await page.getByPlaceholder('联系人姓名').fill('测试联系人');
|
|
await page.getByPlaceholder('所属行业').fill('测试行业');
|
|
|
|
await page.locator('.el-dialog__footer').getByRole('button', { name: /确|保存|提交/ }).click();
|
|
await expect(page.locator('.el-message--success')).toBeVisible({ timeout: 5000 });
|
|
});
|
|
|
|
test('Step 2: 创建订单', async ({ page }) => {
|
|
await page.goto('/orders');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
await page.getByRole('button', { name: '新建订单' }).click();
|
|
// el-drawer 打开
|
|
await expect(page.getByLabel('新建订单')).toBeVisible({ timeout: 5000 });
|
|
await expect(page.getByText('订单明细')).toBeVisible({ timeout: 3000 });
|
|
});
|
|
|
|
test('Step 3: 验证订单列表', async ({ page }) => {
|
|
await page.goto('/orders');
|
|
await page.waitForLoadState('networkidle');
|
|
await expect(page.locator('.el-table').first()).toBeVisible({ timeout: 5000 });
|
|
});
|
|
});
|