ci(frontend): 提高前端流水线及端到端测试稳定性
前端验证 / verify (push) Failing after 15m3s

- 使用内部 checkout 镜像,并校验运行环境中的 Node.js 22
- 检测预览服务端口冲突并重试,避免并行测试误连其他进程
- 调整布局测试的视口宽度和溢出断言,兼容经典滚动条
- 增加时钟暂停的时间余量,避免 CI 调度延迟导致测试失败
This commit is contained in:
cneicy committed 2026-11-06 20:24:56 +08:00
1 parent 6041d717f7
commit 5d080cacec
4 files changed
+69 -48

No files matched your search

+6 -5
View File
@@ -215,7 +215,7 @@ async function bannerGeometry(page) {
textBottom: text.bottom,
topbarTop: bar.top,
topbarBottom: bar.bottom,
viewport: innerWidth,
viewport: document.documentElement.clientWidth,
scrollWidth: document.documentElement.scrollWidth,
};
});
@@ -242,10 +242,11 @@ test(
state.topbarTop >= state.bottom - 0.5,
"The full notice and topbar must occupy separate visible regions",
);
assert.equal(
state.scrollWidth,
state.viewport,
"A maintenance notice must not widen the document",
// 根元素使用 scrollbar-gutter: stable;Linux/Windows 的经典滚动条预留槽位后,
// 内容宽度会比视口窄 15px,只有 macOS 覆盖式滚动条才会相等。验收只要求不产生横向溢出。
assert.ok(
state.scrollWidth <= state.viewport,
`A maintenance notice must not widen the document: ${state.scrollWidth} > ${state.viewport}`,
);
sizes.push({ width, noticeFits: true, headerBelowNotice: true });
}