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:
28
erp-frontend-vue/tests/warehouse-issue.spec.ts
Normal file
28
erp-frontend-vue/tests/warehouse-issue.spec.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
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, '/warehouse/issue')
|
||||
await expect(page).toHaveURL(/\/warehouse\/issue/)
|
||||
await expectBasicList(page)
|
||||
|
||||
const issueCodeInput = page.getByPlaceholder(/领料单号|单据编号/).first().catch(() => null)
|
||||
if (issueCodeInput) {
|
||||
await issueCodeInput.fill('TEST')
|
||||
await page.getByRole('button', { name: /搜索|查询/ }).click()
|
||||
}
|
||||
|
||||
const addBtn = page.getByRole('button', { name: /新建|新增/ }).first()
|
||||
if (await addBtn.isVisible().catch(() => false)) {
|
||||
await addBtn.click()
|
||||
await expect(page).toHaveURL(/\/warehouse\/issue\/(new|edit|form)/)
|
||||
await expect(page.locator('.el-form').first()).toBeVisible()
|
||||
await expect(page.locator('.el-table').first()).toBeVisible()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user