6d92024b63
- 修复API测试认证问题:创建全局认证设置,更新Playwright配置 - 优化回归测试稳定性:增加超时时间到15秒,修复定位器 - 创建Woodpecker CI工作流:CI、部署和质量门禁配置 - 添加Jest配置和测试脚本 - 移除登录页面的默认账号密码显示(安全问题修复)
75 lines
1.4 KiB
TypeScript
75 lines
1.4 KiB
TypeScript
import { PageConfig } from '../types';
|
|
|
|
export const testPages: Record<string, PageConfig> = {
|
|
home: {
|
|
name: '首页',
|
|
url: '/',
|
|
selectors: {
|
|
title: 'h1',
|
|
hero: '.hero-section',
|
|
features: '.features-section'
|
|
}
|
|
},
|
|
about: {
|
|
name: '关于我们',
|
|
url: '/about',
|
|
selectors: {
|
|
title: 'h1',
|
|
content: '.about-content'
|
|
}
|
|
},
|
|
contact: {
|
|
name: '联系我们',
|
|
url: '/contact',
|
|
selectors: {
|
|
title: 'h1',
|
|
form: '#contact-form',
|
|
submitButton: 'button[type="submit"]'
|
|
}
|
|
},
|
|
products: {
|
|
name: '产品',
|
|
url: '/products',
|
|
selectors: {
|
|
title: 'h1',
|
|
productGrid: '.products-grid',
|
|
productCard: '.product-card'
|
|
}
|
|
},
|
|
services: {
|
|
name: '服务',
|
|
url: '/services',
|
|
selectors: {
|
|
title: 'h1',
|
|
servicesList: '.services-list',
|
|
serviceItem: '.service-item'
|
|
}
|
|
},
|
|
cases: {
|
|
name: '案例',
|
|
url: '/cases',
|
|
selectors: {
|
|
title: 'h1',
|
|
casesGrid: '.cases-grid',
|
|
caseCard: '.case-card'
|
|
}
|
|
},
|
|
news: {
|
|
name: '新闻',
|
|
url: '/news',
|
|
selectors: {
|
|
title: 'h1',
|
|
newsList: '.news-list',
|
|
newsItem: '.news-item'
|
|
}
|
|
}
|
|
};
|
|
|
|
export function getPageConfig(pageKey: string): PageConfig {
|
|
return testPages[pageKey] ?? testPages.home!;
|
|
}
|
|
|
|
export function getAllPageConfigs(): PageConfig[] {
|
|
return Object.values(testPages);
|
|
}
|