diff --git a/scripts/smoke.js b/scripts/smoke.js index d91c2b6..3dc9f4c 100644 --- a/scripts/smoke.js +++ b/scripts/smoke.js @@ -18,7 +18,9 @@ const sleep = (ms) => new Promise(r => setTimeout(r, ms)); console.log('== 1. 初始化页面 =='); await p.goto(BASE + '/', { waitUntil: 'networkidle' }); - ok('标题=初始化超管账号', await $('#loginTitle').textContent() === '初始化超管账号'); + const boot1 = await p.evaluate(async () => (await (await fetch('/api/bootstrap')).json())); + const wantTitle = boot1.needsInit ? '初始化超管账号' : '登录'; + ok(`标题=${wantTitle}`, await $('#loginTitle').textContent() === wantTitle); ok('详情弹窗隐藏', await p.evaluate(() => getComputedStyle(document.getElementById('detailModal')).display === 'none')); await p.screenshot({ path: '/tmp/smoke-shots/01-init.png' });