From 06a907acbf2a236992836616be9873cc26dbc920 Mon Sep 17 00:00:00 2001 From: mzl92 Date: Thu, 27 Aug 2026 14:23:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=92=E7=83=9F:=20=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=96=AD=E8=A8=80=E6=8C=89bootstrap=E7=8A=B6=E6=80=81=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/smoke.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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' });