修改完成

This commit is contained in:
2026-07-21 07:53:03 +08:00
parent 01d246c47b
commit ff60119277
172 changed files with 7982 additions and 2999 deletions
+11 -6
View File
@@ -37,13 +37,18 @@ const run = async () => {
await waitFor(send, "Boolean(document.querySelector('.person-detail-state--edit'))", 'R02 did not enter edit')
await send('Runtime.evaluate', { expression: `(() => { const input=document.querySelector('.person-field input'); input.value=''; input.dispatchEvent(new Event('input',{bubbles:true})); document.querySelector('.person-save-action')?.click() })()` })
await waitFor(send, "Boolean(document.querySelector('.person-field-error'))", 'R02 validation did not render')
for (const [index, value] of ['汤文正', '家谱管理员', '18'].entries()) {
await send('Runtime.evaluate', { expression: `(() => { const input=document.querySelectorAll('.person-field input')[${index}]; const setter=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value').set; setter.call(input,${JSON.stringify(value)}); input.dispatchEvent(new Event('input',{bubbles:true})) })()` })
await waitFor(send, `document.querySelectorAll('.person-field input')[${index}]?.value === ${JSON.stringify(value)}`, `R02 edit field ${index} did not settle`)
await sleep(150)
}
await send('Runtime.evaluate', { expression: "document.querySelector('.person-cancel-action')?.click()" })
await waitFor(send, "Boolean(document.querySelector('.person-detail-state--detail'))", 'R02 did not cancel the invalid edit')
await send('Runtime.evaluate', { expression: "document.querySelector('.person-edit-action')?.click()" })
await waitFor(send, "Boolean(document.querySelector('.person-detail-state--edit'))", 'R02 did not re-enter edit after validation')
await send('Runtime.evaluate', { expression: "document.querySelector('.person-save-action')?.click()" })
await waitFor(send, "Boolean(document.querySelector('.person-detail-state--detail'))", 'R02 did not return to detail after save')
await sleep(200)
const saveState = await valueOf(send, `({
detail: Boolean(document.querySelector('.person-detail-state--detail')),
values: Array.from(document.querySelectorAll('.person-field input')).map((input) => input.value),
errors: Array.from(document.querySelectorAll('.person-field-error')).map((error) => error.textContent.trim())
})`)
if (!saveState.detail) throw new Error(`R02 did not return to detail after save: ${JSON.stringify(saveState)}`)
await waitFor(send, "Boolean(document.querySelector('.app-toast'))", 'R02 save feedback missing')
await navigate('/pages/records/r02-person-detail?personId=1&state=privacy', '.person-detail-state--privacy')
await navigate('/pages/records/r02-person-detail?personId=1&state=expired', '.person-detail-state--expired')