冒烟: 标题断言按bootstrap状态自适应

This commit is contained in:
mzl92
2026-08-27 14:23:34 +08:00
parent 34efe3842a
commit 06a907acbf
+3 -1
View File
@@ -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' });