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() } }) })