Files
novalon-website/e2e/footer-beian-verify.spec.ts
T
zhangxiang 6bb7c557ee test(qa): e2e 装配修正 + 集成/门禁测试与工具链重构
- e2e:修死选择器与蜜罐误命中、补断言、GA4/security-headers 用例诚实标注
  skip 边界;新增 assert-helpers/fixtures/hydrated/primary-nav/touch-targets
  等复用桩。
- 集成层:config/test/jest.integration.config.js + tests-integration/ 真库
  一次性 SQLite 用例,teardown 守卫开发库指纹。
- 门禁工具链:jest.setup 归位到根、scripts/accessibility 全站 axe 节点计数、
  check-brand-text-token/check-motion-constraints 机械守卫、stryker/lighthouse
  配置收敛。
2026-09-28 10:48:08 +08:00

52 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test, expect } from './fixtures';
test.describe('Footer ICP/Police BeiAn Visibility', { tag: '@regression' }, () => {
test('desktop: ICP and police bei an should be visible', async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 900 });
await page.goto('/', { waitUntil: 'domcontentloaded' });
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('/', { waitUntil: 'domcontentloaded' });
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));
}
});
});