auto(a17f98b34161): session end @ 2026-06-16T20:23:15 (+2f)
This commit is contained in:
1 parent
637b570df4
commit
c63075b774
2 files changed
+78
-17
No files matched your search
@@ -143,6 +143,44 @@ export function buildFormCreateCommand(): Command {
|
||||
const formData = {
|
||||
formRef: 'formRef',
|
||||
formModel: 'dataForm',
|
||||
size: 'middle',
|
||||
labelPosition: 'right',
|
||||
labelWidth: 100,
|
||||
labelSuffix: '',
|
||||
formRules: 'rules',
|
||||
popupType: 'general',
|
||||
generalWidth: '600px',
|
||||
fullScreenWidth: '100%',
|
||||
drawerWidth: '600px',
|
||||
gutter: 15,
|
||||
disabled: false,
|
||||
span: 24,
|
||||
colon: false,
|
||||
hasCancelBtn: true,
|
||||
cancelButtonText: '取消',
|
||||
cancelButtonTextI18nCode: 'common.cancelText',
|
||||
hasConfirmBtn: true,
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonTextI18nCode: 'common.okText',
|
||||
hasConfirmAndAddBtn: true,
|
||||
hasPrintBtn: false,
|
||||
printButtonText: '打印',
|
||||
printButtonTextI18nCode: 'common.printText',
|
||||
customBtns: [],
|
||||
appCustomBtns: [],
|
||||
primaryKeyPolicy: 1,
|
||||
concurrencyLock: false,
|
||||
logicalDelete: false,
|
||||
dataLog: false,
|
||||
useBusinessKey: false,
|
||||
businessKeyList: [],
|
||||
businessKeyTip: '数据已存在,请勿重复提交!',
|
||||
printId: '',
|
||||
formStyle: '',
|
||||
classNames: [],
|
||||
className: [],
|
||||
classJson: '',
|
||||
detailExtraList: [],
|
||||
fields: fieldsArr,
|
||||
tableName: opts.enCode,
|
||||
}
|
||||
|
||||
@@ -1,32 +1,55 @@
|
||||
/**
|
||||
* tests/e2e/spike-clone-verify.spec.ts
|
||||
*
|
||||
* 验证 spikecln08052 是否真的出现在 web formDesign 列表中
|
||||
* 用 web 自动生成的菜单 enCode (spike_dm7db71) 实际访问, 看能用吗
|
||||
*/
|
||||
import { test, expect } from '@playwright/test'
|
||||
|
||||
test('VERIFY: web formDesign 能看到 spikecln08052 吗', async ({ page }) => {
|
||||
test('VERIFY: spike_dm 真能通过菜单访问吗', async ({ page }) => {
|
||||
test.setTimeout(60_000)
|
||||
await page.goto('/jnpf_app_backend_tdd/onlineDev/formDesign')
|
||||
|
||||
// 用 web 自动生成的菜单 enCode
|
||||
const url = `/jnpf_app_tdd/model/spike_dm7db71`
|
||||
console.log(`[VERIFY] 打开: ${url}`)
|
||||
await page.goto(url)
|
||||
await page.waitForLoadState('networkidle')
|
||||
await page.waitForTimeout(3_000)
|
||||
await page.screenshot({ path: 'screenshots/spike_dm-real-page.png', fullPage: true })
|
||||
|
||||
// 截图
|
||||
await page.screenshot({ path: 'screenshots/verify-clone-list.png', fullPage: true })
|
||||
// 检查是否 404
|
||||
const is404 = await page.locator('text=/未找到页面|404/').count()
|
||||
console.log(`[VERIFY] 是否 404: ${is404 > 0}`)
|
||||
|
||||
// 找 spikecln08052
|
||||
const spikeRow = page.locator('.vxe-body--row').filter({ hasText: 'spikecln08052' })
|
||||
const spikeCount = await spikeRow.count()
|
||||
console.log(`[VERIFY] spikecln08052 在 web 列表的行数: ${spikeCount}`)
|
||||
// 检查表单字段
|
||||
const hasInput = await page.locator('input[placeholder*="名称"], input[placeholder*="名称"]').count()
|
||||
const hasTable = await page.locator('.vxe-table, .ant-table').count()
|
||||
const newBtn = await page.locator('button:has-text("新增"), button:has-text("新 增")').count()
|
||||
console.log(`[VERIFY] input=${hasInput}, table=${hasTable}, 新增按钮=${newBtn}`)
|
||||
|
||||
// 打印所有 enCode
|
||||
const codes = await page.locator('.vxe-body--row').allTextContents()
|
||||
console.log(`[VERIFY] 所有行: ${JSON.stringify(codes.slice(0, 30))}`)
|
||||
if (newBtn > 0) {
|
||||
console.log(`[VERIFY] 点"新增"试一下`)
|
||||
await page.locator('button:has-text("新增"), button:has-text("新 增")').first().click()
|
||||
await page.waitForTimeout(2_000)
|
||||
await page.screenshot({ path: 'screenshots/spike_dm-new-modal.png', fullPage: true })
|
||||
|
||||
if (spikeCount > 0) {
|
||||
console.log(`\n[VERIFY] 🎉 spikecln08052 真的在 web 列表中!`)
|
||||
await expect(spikeRow.first()).toBeVisible()
|
||||
} else {
|
||||
console.log(`\n[VERIFY] ⚠️ spikecln08052 不在 web 列表`)
|
||||
const modalCount = await page.locator('.ant-modal:visible').count()
|
||||
console.log(`[VERIFY] 新增弹窗数: ${modalCount}`)
|
||||
|
||||
if (modalCount > 0) {
|
||||
// 填字段 + 提交
|
||||
const inputInModal = page.locator('.ant-modal input[placeholder*="名称"]').first()
|
||||
if ((await inputInModal.count()) > 0) {
|
||||
await inputInModal.fill('spike_dm_验证值')
|
||||
await page.waitForTimeout(300)
|
||||
// 点确定
|
||||
const okBtn = page.locator('.ant-modal button.ant-btn-primary, .ant-modal button:has-text("确 定")').first()
|
||||
if ((await okBtn.count()) > 0) {
|
||||
await okBtn.click({ force: true })
|
||||
await page.waitForTimeout(3_000)
|
||||
await page.screenshot({ path: 'screenshots/spike_dm-after-submit.png', fullPage: true })
|
||||
console.log(`[VERIFY] 提交完成, 看数据是否入库`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user