完成50%

This commit is contained in:
2026-07-23 08:23:59 +08:00
parent 9b0ad62df4
commit f1edc6b533
218 changed files with 24318 additions and 5514 deletions
+27 -9
View File
@@ -79,27 +79,45 @@ const run = async () => {
await open(socket, send, '?state=empty', '.overview-state--empty')
await open(socket, send, '?state=error&genealogyId=1001', '.overview-state--error')
await open(socket, send, '?state=no-permission&genealogyId=1001', '.overview-state--no-permission')
await open(socket, send, '?mode=public&genealogyId=2001', '.overview-public')
await open(socket, send, '?genealogyId=2001', '.overview-public')
if ((await valueOf(send, "document.querySelectorAll('.overview-public__details > uni-view').length")) !== 5) throw new Error('G05 public preview is missing identity details')
if (await valueOf(send, "Boolean(document.querySelector('.overview-actions'))")) throw new Error('G05 public preview exposed member actions')
await valueOf(send, "document.querySelector('.overview-public__action').click()")
await waitFor(send, "location.href.includes('/pages/genealogy/g08-join-application?source=search&genealogyId=2001')", 'G05 public apply action did not open G08 search source')
await waitFor(send, "location.href.includes('/pages/genealogy/g08-join-application?genealogyId=2001&source=search&sourceKey=G05')", 'G05 public apply action did not open G08 search source')
await open(socket, send, '?role=member&genealogyId=1001', '.overview-ready')
await open(socket, send, '?genealogyId=2003', '.overview-public')
if (!(await valueOf(send, "document.querySelector('.overview-public__action')?.textContent.includes('查看申请进度')"))) throw new Error('G05 pending preview exposed a duplicate application action')
await valueOf(send, "document.querySelector('.overview-public__action').click()")
await waitFor(send, "location.href.includes('/pages/genealogy/g09-my-applications?status=pending&sourceKey=G05')", 'G05 pending preview did not open G09')
await open(socket, send, '?genealogyId=1002', '.overview-ready')
if ((await valueOf(send, "document.querySelectorAll('.overview-action').length")) !== 2) throw new Error('G05 member overview exposed owner actions')
if (await valueOf(send, "document.querySelector('.header-action')?.textContent.trim().length > 0")) throw new Error('G05 member overview exposed management action')
if ((await valueOf(send, "document.querySelectorAll('.overview-summary').length")) !== 2) throw new Error('G05 member overview left illustrated cells empty')
if (await valueOf(send, "Boolean(document.querySelector('.header-action'))")) throw new Error('G05 member overview exposed a duplicate header management entry')
await open(socket, send, '?genealogyId=1001', '.overview-ready')
if ((await valueOf(send, "document.querySelectorAll('.overview-action').length")) !== 4) throw new Error('G05 owner overview is missing management actions')
await valueOf(send, "document.querySelector('.overview-action--ancestor')?.click()")
await waitFor(send, "location.href.includes('/pages/genealogy/g03-create-genealogy?step=ancestor&genealogyId=1001')", 'G05 ancestor action did not open the G03 ancestor step')
await open(socket, send, '?role=member&mode=public&genealogyName=伪造谱名&genealogyId=1001', '.overview-ready')
if ((await valueOf(send, "document.querySelectorAll('.overview-action').length")) !== 4) throw new Error('G05 owner overview did not fill its four canonical action cells')
if (await valueOf(send, "Boolean(document.querySelector('.overview-action--ancestor'))")) throw new Error('G05 retained the duplicate first-ancestor entry')
if (!await valueOf(send, "Boolean(document.querySelector('.overview-action--settings'))")) throw new Error('G05 owner overview is missing its canonical settings entry')
if (await valueOf(send, "Boolean(document.querySelector('.header-action'))")) throw new Error('G05 owner overview retained the duplicate header management entry')
if ((await valueOf(send, "document.querySelector('.overview-hero__title')?.textContent.trim()")) !== '汤氏家谱') throw new Error('G05 accepted an untrusted genealogyName override')
await open(socket, send, '?genealogyId=local-created-genealogy', '.overview-public')
if ((await valueOf(send, "document.querySelector('.overview-public__eyebrow')?.textContent.trim()")) !== '本地流程预览') throw new Error('G05 local creation did not enter preview mode')
if (await valueOf(send, "Boolean(document.querySelector('.overview-actions, .overview-public__action'))")) throw new Error('G05 local preview exposed a member, management or join action')
if (await valueOf(send, "Boolean(document.querySelector('.header-action'))")) throw new Error('G05 local preview exposed a header management entry')
await open(socket, send, '?genealogyId=unknown', '.overview-state--no-permission')
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 })
await open(socket, send, '?mode=public&genealogyId=2001', '.overview-public')
await open(socket, send, '?genealogyId=2001', '.overview-public')
const width = await valueOf(send, 'document.documentElement.scrollWidth')
if (width > size.width + 1) throw new Error(`G05 has horizontal overflow at ${size.width}x${size.height}`)
}
await open(socket, send, '?genealogyId=1001', '.overview-ready')
await valueOf(send, "document.querySelector('.header-back')?.click()")
await waitFor(send, "location.href.includes('/pages/genealogy/g01-my-genealogies')", 'G05 deep-link back did not fall back to G01')
if (exceptions.length) throw new Error(`G05 raised browser exceptions: ${exceptions.join('; ')}`)
process.stdout.write('G05-OVERVIEW-RUNTIME-SMOKE PASS\n')
} finally {