- 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
103 lines
4.1 KiB
TypeScript
103 lines
4.1 KiB
TypeScript
// @ts-nocheck
|
|
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('Page title verification after fixes', () => {
|
|
test('about page title has no duplicate company name', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/about');
|
|
await page.waitForLoadState('networkidle');
|
|
const title = await page.title();
|
|
expect(title).toBe('关于我们 - 睿新致远 | 四川睿新致远科技有限公司');
|
|
expect(title.match(/睿新致远/g)?.length).toBeLessThanOrEqual(2);
|
|
});
|
|
|
|
test('contact page title has no duplicate company name', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/contact');
|
|
await page.waitForLoadState('networkidle');
|
|
const title = await page.title();
|
|
expect(title).toBe('联系我们 - 睿新致远 | 四川睿新致远科技有限公司');
|
|
});
|
|
|
|
test('team page title uses displayName', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/team');
|
|
await page.waitForLoadState('networkidle');
|
|
const title = await page.title();
|
|
expect(title).toContain('睿新致远');
|
|
expect(title).not.toContain('睿新致遠');
|
|
});
|
|
|
|
test('news page title uses displayName', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/news');
|
|
await page.waitForLoadState('networkidle');
|
|
const title = await page.title();
|
|
expect(title).toBe('新闻动态 - 睿新致远 | 四川睿新致远科技有限公司');
|
|
});
|
|
|
|
test('products page title uses displayName', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/products');
|
|
await page.waitForLoadState('networkidle');
|
|
const title = await page.title();
|
|
expect(title).toBe('产品 - 睿新致远 | 四川睿新致远科技有限公司');
|
|
});
|
|
|
|
test('services page title uses displayName', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/services');
|
|
await page.waitForLoadState('networkidle');
|
|
const title = await page.title();
|
|
expect(title).toBe('服务 - 睿新致远 | 四川睿新致远科技有限公司');
|
|
});
|
|
|
|
test('solutions page title uses displayName', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/solutions');
|
|
await page.waitForLoadState('networkidle');
|
|
const title = await page.title();
|
|
expect(title).toBe('解决方案 - 睿新致远 | 四川睿新致远科技有限公司');
|
|
});
|
|
|
|
test('privacy page title uses displayName', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/privacy');
|
|
await page.waitForLoadState('networkidle');
|
|
const title = await page.title();
|
|
expect(title).toBe('隐私政策 - 睿新致远 | 四川睿新致远科技有限公司');
|
|
});
|
|
|
|
test('terms page title uses displayName', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/terms');
|
|
await page.waitForLoadState('networkidle');
|
|
const title = await page.title();
|
|
expect(title).toBe('服务条款 - 睿新致远 | 四川睿新致远科技有限公司');
|
|
});
|
|
|
|
test('news category filter works correctly', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/news');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
const allNews = page.locator('a[href*="/news/"]');
|
|
const initialCount = await allNews.count();
|
|
expect(initialCount).toBe(2);
|
|
|
|
const companyNewsBtn = page.locator('button:has-text("公司新闻")');
|
|
await companyNewsBtn.click();
|
|
await page.waitForTimeout(500);
|
|
|
|
const filteredCount = await allNews.count();
|
|
expect(filteredCount).toBe(1);
|
|
|
|
const productNewsBtn = page.locator('button:has-text("产品发布")');
|
|
await productNewsBtn.click();
|
|
await page.waitForTimeout(500);
|
|
|
|
const productFilteredCount = await allNews.count();
|
|
expect(productFilteredCount).toBe(1);
|
|
});
|
|
|
|
test('hero section still uses shortName for visual branding', async ({ page }) => {
|
|
await page.goto('http://localhost:3000');
|
|
await page.waitForLoadState('networkidle');
|
|
const heroText = page.locator('.font-brand').first();
|
|
if (await heroText.isVisible()) {
|
|
const text = await heroText.textContent();
|
|
expect(text).toContain('睿新致遠');
|
|
}
|
|
});
|
|
});
|