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
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
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()
|
|
}
|
|
})
|
|
})
|
|
|