test(e2e): add GA4 tracking, mobile, user journey tests and update visual baselines

- Add GA4 event tracking E2E tests (4 cases: page view, form submit, button click, product page)
- Add mobile-specific E2E tests (16 cases: navigation, form, product browsing)
- Add user journey tests (UJ-01: homepage to contact, UJ-02: product discovery)
- Fix E2E test selectors and assertions for consistency
- Update visual regression baselines across all browsers (chromium/firefox/webkit)
- Update Playwright config for new test files
This commit is contained in:
2026-07-31 20:24:57 +08:00
parent dd088a5ee1
commit 3e629bd9ee
27 changed files with 964 additions and 58 deletions
+4 -4
View File
@@ -15,7 +15,7 @@ import { test, expect } from '@playwright/test';
test.setTimeout(60000);
// ==================== 关键页面的跨浏览器一致性测试 ====================
test.describe('跨浏览器 - 核心页面渲染', () => {
test.describe('跨浏览器 - 核心页面渲染', { tag: '@regression' }, () => {
const criticalPages = [
{ path: '/', name: '首页' },
@@ -67,7 +67,7 @@ test.describe('跨浏览器 - 核心页面渲染', () => {
});
// ==================== 多设备视口适配测试 ====================
test.describe('多设备 - 视口响应式布局', () => {
test.describe('多设备 - 视口响应式布局', { tag: '@regression' }, () => {
const viewports = [
{ name: 'Desktop XL', width: 1920, height: 1080, type: 'desktop' as const },
@@ -131,7 +131,7 @@ test.describe('多设备 - 视口响应式布局', () => {
});
// ==================== 特定浏览器行为测试 ====================
test.describe('特定浏览器 - 行为差异检查', () => {
test.describe('特定浏览器 - 行为差异检查', { tag: '@regression' }, () => {
test('字体回退机制工作正常', async ({ page }) => {
await page.goto('/', { waitUntil: 'domcontentloaded', timeout: 30000 });
@@ -218,7 +218,7 @@ test.describe('特定浏览器 - 行为差异检查', () => {
});
// ==================== 触摸设备模拟测试 ====================
test.describe('触摸设备 - 手势交互', () => {
test.describe('触摸设备 - 手势交互', { tag: '@regression' }, () => {
test('触摸滑动流畅(无卡顿)', async ({ page, browserName }) => {
// touchscreen API is only available in Chromium with touch emulation