33 lines
1.2 KiB
TypeScript
33 lines
1.2 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, '/production/purchase-plan')
|
||
|
|
await expect(page).toHaveURL(/\/production\/purchase-plan/)
|
||
|
|
await expectBasicList(page)
|
||
|
|
|
||
|
|
const planCodeInput = page.getByPlaceholder(/计划单号|采购计划/).first().catch(() => null)
|
||
|
|
if (planCodeInput) {
|
||
|
|
await planCodeInput.fill('TEST')
|
||
|
|
await page.getByRole('button', { name: /搜索|查询/ }).click()
|
||
|
|
}
|
||
|
|
|
||
|
|
const addBtn = page.getByRole('button', { name: /新增|新建/ }).first()
|
||
|
|
await addBtn.click()
|
||
|
|
await expect(page).toHaveURL(/\/production\/purchase-plan\/(new|edit|form)/)
|
||
|
|
await expect(page.locator('.el-form').first()).toBeVisible()
|
||
|
|
await page.goBack().catch(() => {})
|
||
|
|
|
||
|
|
const exportBtn = page.getByRole('button', { name: /导出/ }).first()
|
||
|
|
if (await exportBtn.isVisible().catch(() => false)) {
|
||
|
|
await exportBtn.click()
|
||
|
|
// 此处主要校验点击不报错
|
||
|
|
}
|
||
|
|
})
|
||
|
|
})
|
||
|
|
|