- 新增 ADR 架构决策记录 (Design DNA 集成与深化) - 新增 CMS 系统设计文档 - 新增实施计划文档 (Phase1-3) - 新增 Bain 品牌升级设计规格 - 新增 E2E 分层测试套件 (P1-P4) - 新增视觉回归测试配置 - 新增光效分析、视觉验证等辅助脚本 - 更新验收测试报告
54 lines
1.9 KiB
TypeScript
54 lines
1.9 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
||
|
||
test.describe('Footer ICP/Police BeiAn Visibility', () => {
|
||
test('desktop: ICP and police bei an should be visible', async ({ page }) => {
|
||
await page.setViewportSize({ width: 1440, height: 900 });
|
||
await page.goto('/');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight));
|
||
await page.waitForTimeout(500);
|
||
|
||
const icp = page.getByText(/蜀ICP备/);
|
||
const police = page.getByText(/川公网安备/);
|
||
|
||
await expect(icp).toBeVisible();
|
||
await expect(police).toBeVisible();
|
||
|
||
const icpBox = await icp.boundingBox();
|
||
const policeBox = await police.boundingBox();
|
||
|
||
console.log('桌面端 ICP位置:', icpBox);
|
||
console.log('桌面端 公安备案位置:', policeBox);
|
||
});
|
||
|
||
test('mobile: ICP and police bei an should be visible above tab bar', async ({ page }) => {
|
||
await page.setViewportSize({ width: 390, height: 844 });
|
||
await page.goto('/');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight));
|
||
await page.waitForTimeout(500);
|
||
|
||
const icp = page.getByText(/蜀ICP备/);
|
||
const police = page.getByText(/川公网安备/);
|
||
|
||
await expect(icp).toBeVisible();
|
||
await expect(police).toBeVisible();
|
||
|
||
const icpBox = await icp.boundingBox();
|
||
const policeBox = await police.boundingBox();
|
||
const viewport = page.viewportSize();
|
||
|
||
console.log('移动端 ICP位置:', icpBox);
|
||
console.log('移动端 公安备案位置:', policeBox);
|
||
console.log('移动端 视口高度:', viewport.height);
|
||
|
||
// 确保备案信息在视口内(底部tab bar高度约64px + safe area)
|
||
const tabBarEstimatedBottom = viewport.height;
|
||
if (icpBox) {
|
||
console.log('ICP底部距离视口底部:', tabBarEstimatedBottom - (icpBox.y + icpBox.height));
|
||
}
|
||
});
|
||
});
|