Files
my-mom-system/erp-frontend-vue/tests/production-need-report.spec.ts

43 lines
1.6 KiB
TypeScript
Raw Normal View History

import { test, expect } from '@playwright/test'
import { login, clickSubMenu, clickMenuItem, expectBasicList } from './utils/erpTestUtils'
test.describe('采购计划需求表页面', () => {
test('报表查询基础交互', async ({ page }) => {
2026-03-06 02:02:59 +08:00
await test.step('步骤1登录系统', async () => {
await login(page)
})
2026-03-06 02:02:59 +08:00
await test.step('步骤2导航到采购计划需求表页面', async () => {
await clickSubMenu(page, '生产计划')
await clickMenuItem(page, '/production/report/need')
await expect(page).toHaveURL(/\/production\/report\/need/)
})
2026-03-06 02:02:59 +08:00
await test.step('步骤3检查页面基本布局', async () => {
await expectBasicList(page)
})
2026-03-06 02:02:59 +08:00
await test.step('步骤4选择日期范围', async () => {
const dateRange = page.getByPlaceholder(/开始日期|结束日期|选择日期范围/).first()
if (await dateRange.count() > 0) {
await dateRange.click()
const todayBtn = page.getByRole('button', { name: /今/ }).first()
if (await todayBtn.count() > 0) {
await todayBtn.click()
}
const confirmBtn = page.getByRole('button', { name: /确 定|确定/ }).first()
if (await confirmBtn.count() > 0) {
await confirmBtn.click()
}
}
})
await test.step('步骤5点击搜索按钮并检查表格', async () => {
const searchBtn = page.getByRole('button', { name: /搜索|查询/ }).first()
await searchBtn.click()
await expect(page.locator('.el-table').first()).toBeVisible()
})
})
})