docs(test): 添加设计文档、测试规范与 E2E 测试套件

- 新增 ADR 架构决策记录 (Design DNA 集成与深化)
- 新增 CMS 系统设计文档
- 新增实施计划文档 (Phase1-3)
- 新增 Bain 品牌升级设计规格
- 新增 E2E 分层测试套件 (P1-P4)
- 新增视觉回归测试配置
- 新增光效分析、视觉验证等辅助脚本
- 更新验收测试报告
This commit is contained in:
张翔
2026-07-07 06:54:25 +08:00
parent 8def296301
commit 636bc4ecde
31 changed files with 9262 additions and 41 deletions
+49
View File
@@ -0,0 +1,49 @@
import { chromium } from '@playwright/test';
import * as fs from 'fs';
import * as path from 'path';
(async () => {
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
console.log('正在访问首页...');
await page.goto('http://localhost:3000');
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const screenshotDir = '/tmp/screenshots';
if (!fs.existsSync(screenshotDir)) {
fs.mkdirSync(screenshotDir, { recursive: true });
}
// 首页 Hero
await page.screenshot({ path: path.join(screenshotDir, '01-home-hero.png') });
console.log('✓ 首页 Hero 截图已保存');
// Stats 区域
await page.evaluate(() => window.scrollTo(0, 1400));
await page.waitForTimeout(1000);
await page.screenshot({ path: path.join(screenshotDir, '02-stats-section.png') });
console.log('✓ Stats 区域截图已保存');
// 服务区域
await page.evaluate(() => window.scrollTo(0, 2000));
await page.waitForTimeout(1000);
await page.screenshot({ path: path.join(screenshotDir, '03-services-section.png') });
console.log('✓ 服务区域截图已保存');
// CTA 区域
await page.evaluate(() => window.scrollTo(0, 3800));
await page.waitForTimeout(1000);
await page.screenshot({ path: path.join(screenshotDir, '04-cta-section.png') });
console.log('✓ CTA 区域截图已保存');
// 整页截图
await page.evaluate(() => window.scrollTo(0, 0));
await page.waitForTimeout(500);
await page.screenshot({ path: path.join(screenshotDir, '00-full-page.png'), fullPage: true });
console.log('✓ 整页截图已保存');
await browser.close();
console.log('\n所有截图已保存到 /tmp/screenshots/ 目录');
})();