- Raise use-swipe-gesture mutation score to 66.13% (target 65%+) - Maintain use-reduced-motion mutation score at 76.32% (target 50%+) - Fix use-reduced-motion.ts ESLint set-state-in-effect warning - Add UJ-10 deep searcher journey (category browse → article read → content discovery) - Add 40 new test files (analytics, detail, sections, ui, lib components) - Update test-strategy-plan.md to v2.0 (sync test count to 1591) - Sync README.md with final release metrics Quality gates: TS 0 errors, ESLint 0 errors, 121 suites / 1591 tests passed
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
// @ts-nocheck
|
|
import { test } from '@playwright/test';
|
|
import { SEOValidator } from '../../test-framework/shared/utils/seo/SEOValidator';
|
|
import { seoThresholds } from '../../test-framework/shared/config/test-data';
|
|
|
|
test.describe('SEO测试', () => {
|
|
test('首页应该通过SEO验证', async ({ page }) => {
|
|
const validator = new SEOValidator(page);
|
|
await page.goto('/');
|
|
|
|
const result = await validator.validateSEO();
|
|
|
|
console.log(`SEO得分: ${result.score}`);
|
|
console.log(`Meta标签: ${JSON.stringify(result.metaTags)}`);
|
|
console.log(`标题结构: ${JSON.stringify(result.headings)}`);
|
|
|
|
expect(result.score).toBeGreaterThanOrEqual(seoThresholds.score);
|
|
});
|
|
|
|
test('应该有正确的标题结构', async ({ page }) => {
|
|
const validator = new SEOValidator(page);
|
|
await page.goto('/');
|
|
|
|
const headings = await validator.validateHeadings();
|
|
|
|
expect(headings.hasH1).toBe(true);
|
|
expect(headings.multipleH1).toBe(false);
|
|
expect(headings.headingStructure).toBe(true);
|
|
});
|
|
});
|