/** * 财务模块 E2E 测试 (修正版) */ import { test, expect } from '@playwright/test'; test.describe('报销大盘', () => { test('报销大盘页面加载', async ({ page }) => { await page.goto('/finance'); await page.waitForLoadState('networkidle'); await expect(page.locator('body')).toContainText(/票据|发票|报销|费用/, { timeout: 5000 }); }); test('票据相关内容可见', async ({ page }) => { await page.goto('/finance'); await page.waitForLoadState('networkidle'); // 只要页面有相关内容加载 await expect(page.locator('body')).toContainText(/报销|票据|费用|支出/, { timeout: 5000 }); }); }); test.describe('销项发票', () => { test('销项发票页面加载', async ({ page }) => { await page.goto('/finance/sales-invoices'); await page.waitForLoadState('networkidle'); await expect(page.locator('body')).toContainText(/销项发票|发票/, { timeout: 5000 }); }); test('销项发票列表', async ({ page }) => { await page.goto('/finance/sales-invoices'); await page.waitForLoadState('networkidle'); const table = page.locator('.el-table').first(); if (await table.isVisible({ timeout: 5000 })) { await expect(table).toBeVisible(); } }); });