feat: 修复测试套件问题并添加Woodpecker CI配置

- 修复API测试认证问题:创建全局认证设置,更新Playwright配置
- 优化回归测试稳定性:增加超时时间到15秒,修复定位器
- 创建Woodpecker CI工作流:CI、部署和质量门禁配置
- 添加Jest配置和测试脚本
- 移除登录页面的默认账号密码显示(安全问题修复)
This commit is contained in:
张翔
2026-03-09 10:26:02 +08:00
parent 96c96fe75d
commit 6d92024b63
68 changed files with 5584 additions and 167 deletions
+11 -10
View File
@@ -1,6 +1,7 @@
import { test as base } from '@playwright/test';
import { BasePage, HomePage, AboutPage, ContactPage, ProductsPage, ServicesPage, CasesPage, NewsPage } from '../pages';
import { getEnvironmentConfig } from '../config/environments';
import { TestConfig as CustomTestConfig } from '../types';
type MyFixtures = {
basePage: BasePage;
@@ -11,52 +12,52 @@ type MyFixtures = {
servicesPage: ServicesPage;
casesPage: CasesPage;
newsPage: NewsPage;
config: any;
config: CustomTestConfig;
};
export const test = base.extend<MyFixtures>({
config: async ({}, use) => {
config: async ({}, use: (value: CustomTestConfig) => Promise<void>) => {
const env = process.env.TEST_ENV || 'development';
const config = getEnvironmentConfig(env);
await use(config);
},
basePage: async ({ page }, use) => {
basePage: async ({ page }, use: (value: BasePage) => Promise<void>) => {
const basePage = new BasePage(page, '/');
await use(basePage);
},
homePage: async ({ page, config }, use) => {
homePage: async ({ page, config }, use: (value: HomePage) => Promise<void>) => {
const homePage = new HomePage(page, config);
await use(homePage);
},
aboutPage: async ({ page, config }, use) => {
aboutPage: async ({ page, config }, use: (value: AboutPage) => Promise<void>) => {
const aboutPage = new AboutPage(page, config);
await use(aboutPage);
},
contactPage: async ({ page, config }, use) => {
contactPage: async ({ page, config }, use: (value: ContactPage) => Promise<void>) => {
const contactPage = new ContactPage(page, config);
await use(contactPage);
},
productsPage: async ({ page, config }, use) => {
productsPage: async ({ page, config }, use: (value: ProductsPage) => Promise<void>) => {
const productsPage = new ProductsPage(page, config);
await use(productsPage);
},
servicesPage: async ({ page, config }, use) => {
servicesPage: async ({ page, config }, use: (value: ServicesPage) => Promise<void>) => {
const servicesPage = new ServicesPage(page, config);
await use(servicesPage);
},
casesPage: async ({ page, config }, use) => {
casesPage: async ({ page, config }, use: (value: CasesPage) => Promise<void>) => {
const casesPage = new CasesPage(page, config);
await use(casesPage);
},
newsPage: async ({ page, config }, use) => {
newsPage: async ({ page, config }, use: (value: NewsPage) => Promise<void>) => {
const newsPage = new NewsPage(page, config);
await use(newsPage);
}