Files
my-mom-system/erp-frontend-vue/tests/purchasing-order.spec.ts
panchengyong 283f727857 feat(erp-frontend-vue): add Playwright E2E tests and update layout
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
2026-03-02 21:44:03 +08:00

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, '/purchasing/order')
await expect(page).toHaveURL(/\/purchasing\/order/)
await expectBasicList(page)
// 按订单编号/供应商搜索
const codeInput = page.getByPlaceholder(/订单编号|采购订单/).first().catch(() => null)
if (codeInput) {
await codeInput.fill('TEST')
}
await page.getByRole('button', { name: /搜索|查询/ }).click()
// 新增采购订单
const addBtn = page.getByRole('button', { name: /新增|新建/ }).first()
await addBtn.click()
await expect(page).toHaveURL(/\/purchasing\/order\/(new|edit|form)/)
await expect(page.locator('.el-form').first()).toBeVisible()
await expect(page.locator('.el-table').first()).toBeVisible() // 明细
})
})