feat(brand): 首页影像版式与名+号字标上线
- 首页按咨询机构影像版式重排,保留原站文案与“洞察→行业→能力”段序 - 导航/页脚/品牌页换用上下锁定字标,alt 维持法定主体名 - 修复 reduce 下 PageTransition 祖先 opacity 停留导致的白屏 - 4 浏览器 × 9 宽度多端复核,axe 0 violation - 视觉基线 106 张更新并只读复跑 125/125
This commit is contained in:
1 parent
f6e750c318
commit
acb6b67357
153 files changed
+1313
-178
No files matched your search
@@ -51,8 +51,18 @@ for (const { path, lateHeading } of CASES) {
|
||||
|
||||
const h1 = page.locator('h1').first();
|
||||
await expect(h1).toBeVisible({ timeout: 15000 });
|
||||
const h1Opacity = await h1.evaluate((el) => Number(getComputedStyle(el).opacity));
|
||||
expect(h1Opacity, '首屏 h1 不得停在 opacity:0').toBe(1);
|
||||
// 2026-10-20:只看元素自身的 opacity 会漏掉 PageTransition 祖先停在 0.15–0.35 的那类白屏。
|
||||
// 有效可见度必须是祖先链的乘积累积,而不是单节点读数。
|
||||
const h1Opacity = await h1.evaluate((el) => {
|
||||
let op = 1;
|
||||
let n: Element | null = el;
|
||||
while (n) {
|
||||
op *= Number(getComputedStyle(n).opacity);
|
||||
n = n.parentElement;
|
||||
}
|
||||
return op;
|
||||
});
|
||||
expect(h1Opacity, '首屏 h1 的祖先链不得停在半透明/0').toBeGreaterThan(0.99);
|
||||
|
||||
// 滚到底部,让 whileInView 触发;reduce 下应「一步到位」变可见
|
||||
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight));
|
||||
@@ -60,8 +70,20 @@ for (const { path, lateHeading } of CASES) {
|
||||
const late = page.getByRole('heading', { name: lateHeading }).first();
|
||||
await expect(late, '末段标题应存在(页面完整)').toBeVisible({ timeout: 10000 });
|
||||
await expect
|
||||
.poll(async () => late.evaluate((el) => Number(getComputedStyle(el).opacity)), { timeout: 5000 })
|
||||
.toBe(1);
|
||||
.poll(
|
||||
async () =>
|
||||
late.evaluate((el) => {
|
||||
let op = 1;
|
||||
let n: Element | null = el;
|
||||
while (n) {
|
||||
op *= Number(getComputedStyle(n).opacity);
|
||||
n = n.parentElement;
|
||||
}
|
||||
return op;
|
||||
}),
|
||||
{ timeout: 5000 },
|
||||
)
|
||||
.toBeGreaterThan(0.99);
|
||||
|
||||
expect(errors, `出现 hydration 错误:\n${errors.join('\n')}`).toEqual([]);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user