2026-03-02 21:44:03 +08:00
|
|
|
|
import { test, expect } from '@playwright/test'
|
2026-03-06 02:02:59 +08:00
|
|
|
|
import { login, clickSubMenu, clickMenuItem, expectBasicList, closeMessageBox } from './utils/erpTestUtils'
|
2026-03-02 21:44:03 +08:00
|
|
|
|
|
|
|
|
|
|
test.describe('生产订单页面', () => {
|
|
|
|
|
|
test('列表搜索与基本操作按钮存在', async ({ page }) => {
|
2026-03-06 02:02:59 +08:00
|
|
|
|
await test.step('步骤1:登录系统', async () => {
|
|
|
|
|
|
await login(page)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
await test.step('步骤2:导航到生产订单页面', async () => {
|
|
|
|
|
|
await clickSubMenu(page, '生产管理')
|
|
|
|
|
|
await clickMenuItem(page, '/production/work-order')
|
|
|
|
|
|
await expect(page).toHaveURL(/\/production\/work-order/)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
await test.step('步骤3:检查页面基本布局', async () => {
|
|
|
|
|
|
await expectBasicList(page)
|
|
|
|
|
|
await closeMessageBox(page)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
await test.step('步骤4:检查搜索表单', async () => {
|
|
|
|
|
|
const form = page.locator('.el-form').first()
|
|
|
|
|
|
await expect(form).toBeVisible()
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
await test.step('步骤5:执行搜索', async () => {
|
|
|
|
|
|
const searchBtn = page.getByRole('button', { name: /搜索/ }).first()
|
|
|
|
|
|
if (await searchBtn.count() > 0) {
|
|
|
|
|
|
await searchBtn.click()
|
|
|
|
|
|
await closeMessageBox(page)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
await test.step('步骤6:检查工具栏', async () => {
|
|
|
|
|
|
const toolbar = page.locator('.el-form').first()
|
|
|
|
|
|
await expect(toolbar).toBeVisible()
|
|
|
|
|
|
})
|
2026-03-02 21:44:03 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
test('查看工单详情与状态相关操作按钮', async ({ page }) => {
|
2026-03-06 02:02:59 +08:00
|
|
|
|
await test.step('步骤1:登录系统并导航到生产订单页面', async () => {
|
|
|
|
|
|
await login(page)
|
|
|
|
|
|
await clickSubMenu(page, '生产管理')
|
|
|
|
|
|
await clickMenuItem(page, '/production/work-order')
|
|
|
|
|
|
await closeMessageBox(page)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
await test.step('步骤2:检查是否有数据行', async () => {
|
|
|
|
|
|
const firstRow = page.locator('.el-table__row').first()
|
|
|
|
|
|
if (!(await firstRow.isVisible())) test.skip()
|
|
|
|
|
|
})
|
2026-03-02 21:44:03 +08:00
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
|