feat(erp-frontend-vue): add Playwright E2E tests and update layout

Add Playwright configuration and E2E specs for key production, purchasing, and warehouse flows, and update layout/login to align with the new testing setup.

Made-with: Cursor
This commit is contained in:
panchengyong
2026-03-02 21:44:03 +08:00
parent e45616a09b
commit 283f727857
16 changed files with 3230 additions and 818 deletions

View File

@@ -0,0 +1,24 @@
import { test, expect } from '@playwright/test'
import { login, clickSubMenu, clickMenuItem, expectBasicList } from './utils/erpTestUtils'
test.describe('采购计划需求表页面', () => {
test('报表查询基础交互', async ({ page }) => {
await login(page)
await clickSubMenu(page, '生产计划')
await clickMenuItem(page, '/production/report/need')
await expect(page).toHaveURL(/\/production\/report\/need/)
await expectBasicList(page)
const dateRange = page.getByPlaceholder(/开始日期|结束日期|选择日期范围/).first().catch(() => null)
if (dateRange) {
await dateRange.click()
await page.getByRole('button', { name: /今/ }).first().click().catch(() => {})
await page.getByRole('button', { name: /确 定|确定/ }).first().click().catch(() => {})
}
await page.getByRole('button', { name: /搜索|查询/ }).click()
await expect(page.locator('.el-table').first()).toBeVisible()
})
})