完成50%
This commit is contained in:
@@ -66,18 +66,26 @@ const run = async () => {
|
||||
try {
|
||||
await send('Page.enable')
|
||||
await send('Runtime.enable')
|
||||
await open(send, '/pages/genealogy/g08-join-application', '?genealogyId=1002', '.join-state--form')
|
||||
await open(send, '/pages/genealogy/g08-join-application', '?genealogyId=2001', '.join-state--form')
|
||||
await waitFor(send, "document.querySelectorAll('.join-field input').length >= 2", 'G08 real input controls did not render')
|
||||
const prepared = await fillJoinForm(send, '汤明远', '某某某堂侄')
|
||||
if (!prepared) throw new Error('G08 form controls could not be prepared')
|
||||
await valueOf(send, "document.querySelector('.join-action')?.click()")
|
||||
await waitFor(send, "Boolean(document.querySelector('.join-state--success'))", 'G08 real form submission did not reach the same-page success state')
|
||||
if (!(await valueOf(send, "document.body.textContent.includes('申请尚未提交服务器')"))) throw new Error('G08 local search preview claimed a server submission')
|
||||
await valueOf(send, "document.querySelector('.join-result .join-action').click()")
|
||||
await waitFor(send, "location.href.includes('/pages/genealogy/g09-my-applications')", 'G08 local search preview did not continue to G09 without a result')
|
||||
|
||||
for (const genealogyId of ['1001', '1002', '2003', 'unknown']) {
|
||||
await open(send, '/pages/genealogy/g08-join-application', `?role=guest&state=success&source=search&genealogyId=${genealogyId}`, '.join-state--ineligible')
|
||||
if (await valueOf(send, "Boolean(document.querySelector('.join-form'))")) throw new Error(`G08 exposed an application form for ineligible genealogy ${genealogyId}`)
|
||||
}
|
||||
|
||||
// 步骤一:失败输入必须经过真实提交态进入错误结果,并能返回原表单重试。
|
||||
await open(send, '/pages/genealogy/g08-join-application', '?source=search&genealogyId=1002', '.join-state--form')
|
||||
await open(send, '/pages/genealogy/g08-join-application', '?source=search&genealogyId=2001', '.join-state--form')
|
||||
if (!await fillJoinForm(send, '失败', '某某某堂侄')) throw new Error('G08 failure controls could not be prepared')
|
||||
await valueOf(send, "document.querySelector('.join-action').click()")
|
||||
await waitFor(send, "document.querySelector('.join-action')?.textContent.includes('正在提交')", 'G08 did not expose its submitting state')
|
||||
await waitFor(send, "document.querySelector('.join-action')?.textContent.includes('正在校验')", 'G08 did not expose its submitting state')
|
||||
await waitFor(send, "Boolean(document.querySelector('.join-state--error'))", 'G08 simulated submission failure did not render')
|
||||
await valueOf(send, "document.querySelector('.join-result .join-action').click()")
|
||||
await waitFor(send, "Boolean(document.querySelector('.join-state--form'))", 'G08 failure retry did not restore the form')
|
||||
@@ -90,9 +98,9 @@ const run = async () => {
|
||||
await sleep(100)
|
||||
await valueOf(send, "document.querySelector('.join-action').click()")
|
||||
await waitFor(send, "Boolean(document.querySelector('.join-state--success'))", 'G08 invite source did not reach success')
|
||||
if (!(await valueOf(send, "document.body.textContent.includes('无需等待审核')"))) throw new Error('G08 invite source did not preserve direct-join semantics')
|
||||
if (!(await valueOf(send, "document.body.textContent.includes('不会选中或加入这部家谱')"))) throw new Error('G08 invite preview claimed a durable membership change')
|
||||
await valueOf(send, "document.querySelector('.join-result .join-action').click()")
|
||||
await waitFor(send, "location.href.includes('/pages/genealogy/g01-my-genealogies?genealogyId=2001')", 'G08 invite success did not return to selected G01 genealogy')
|
||||
await waitFor(send, "location.href.includes('/pages/genealogy/g01-my-genealogies') && !location.href.includes('genealogyId=2001')", 'G08 invite preview selected a genealogy without backend success')
|
||||
|
||||
for (const size of [{ width: 320, height: 568 }, { width: 360, height: 800 }, { width: 412, height: 915 }]) {
|
||||
await send('Emulation.setDeviceMetricsOverride', { ...size, deviceScaleFactor: 1, mobile: true })
|
||||
@@ -111,9 +119,10 @@ const run = async () => {
|
||||
await valueOf(send, "document.querySelector('.application-card__action').click()")
|
||||
await waitFor(send, "Boolean(document.querySelector('.app-dialog-layer'))", 'G09 pending action did not open custom withdrawal confirmation')
|
||||
await valueOf(send, "document.querySelector('.app-dialog__actions .app-button:last-child').click()")
|
||||
await waitFor(send, "document.querySelector('.application-card__status')?.textContent.includes('已撤回')", 'G09 withdrawal did not update the local status')
|
||||
await waitFor(send, "document.querySelector('.application-card__status')?.textContent.includes('本地撤回预览')", 'G09 withdrawal did not use a local-only status')
|
||||
if (!(await valueOf(send, "document.querySelector('.application-card')?.textContent.includes('尚未提交服务器')"))) throw new Error('G09 local withdrawal claimed a durable server result')
|
||||
await valueOf(send, "document.querySelector('.application-card__status--rejected')?.closest('.application-card')?.querySelector('.application-card__action')?.click()")
|
||||
await waitFor(send, "location.href.includes('/pages/genealogy/g08-join-application?source=search&previous=rejected&genealogyId=')", 'G09 rejected action did not reopen G08 search source')
|
||||
await waitFor(send, "location.href.includes('/pages/genealogy/g08-join-application?genealogyId=2004&source=search&sourceKey=G09')", 'G09 rejected action did not reopen G08 with the canonical contract')
|
||||
await open(send, '/pages/genealogy/g09-my-applications', '?state=empty', '.application-state--empty')
|
||||
await open(send, '/pages/genealogy/g10-application-review', '?genealogyId=1001', '.review-state--list')
|
||||
await valueOf(send, "document.querySelector('.review-actions .app-button:nth-child(2)').click()")
|
||||
@@ -121,6 +130,7 @@ const run = async () => {
|
||||
await valueOf(send, "document.querySelector('.app-dialog__actions .app-button:last-child').click()")
|
||||
await waitFor(send, "document.querySelector('.application-card__status')?.textContent.includes('已通过')", 'G10 approval did not update the card')
|
||||
await waitFor(send, "Boolean(document.querySelector('.review-feedback'))", 'G10 approval did not show custom feedback')
|
||||
if (!(await valueOf(send, "document.querySelector('.review-feedback')?.textContent.includes('尚未提交服务器')"))) throw new Error('G10 local approval claimed a durable server result')
|
||||
await valueOf(send, "document.querySelector('.header-action').click()")
|
||||
await waitFor(send, "document.querySelector('.app-dialog__title')?.textContent.includes('审核说明')", 'G10 help did not use the custom dialog')
|
||||
await valueOf(send, "document.querySelector('.app-dialog__actions .app-button').click()")
|
||||
@@ -144,7 +154,9 @@ const run = async () => {
|
||||
await waitFor(send, "document.querySelector('.application-card__status')?.textContent.includes('已拒绝')", 'G10 rejection did not update the card')
|
||||
await waitFor(send, "Boolean(document.querySelector('.review-feedback'))", 'G10 rejection did not show custom feedback')
|
||||
await open(send, '/pages/genealogy/g10-application-review', '?state=empty&genealogyId=1001', '.review-state--empty')
|
||||
await open(send, '/pages/genealogy/g10-application-review', '?state=no-permission&genealogyId=1001', '.review-state--no-permission')
|
||||
await open(send, '/pages/genealogy/g10-application-review', '?role=owner&state=list&genealogyId=1002', '.review-state--no-permission')
|
||||
if (await valueOf(send, "Boolean(document.querySelector('.application-card'))")) throw new Error('G10 trusted a forged owner role for a non-owner genealogy')
|
||||
await open(send, '/pages/genealogy/g10-application-review', '?state=list&genealogyId=2001', '.review-state--no-permission')
|
||||
if (exceptions.length) throw new Error(`G08-G10 raised browser exceptions: ${exceptions.join('; ')}`)
|
||||
process.stdout.write('G08-G10-APPLICATION-FLOW-RUNTIME-SMOKE PASS\n')
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user