feat: add test data management for admin E2E tests

This commit is contained in:
张翔
2026-03-12 21:51:41 +08:00
parent f357330ba8
commit 27f6278f00
+44
View File
@@ -0,0 +1,44 @@
export const adminTestData = {
users: {
admin: { email: 'contact@novalon.cn', password: 'admin123456' },
editor: { email: 'editor@novalon.cn', password: 'editor123' },
viewer: { email: 'viewer@novalon.cn', password: 'viewer123' }
},
content: {
product: {
type: 'product',
title: '测试产品',
slug: 'test-product',
content: '产品描述内容'
},
service: {
type: 'service',
title: '测试服务',
slug: 'test-service',
content: '服务描述内容'
},
case: {
type: 'case',
title: '测试案例',
slug: 'test-case',
content: '案例描述内容'
},
news: {
type: 'news',
title: '测试新闻',
slug: 'test-news',
content: '新闻内容'
}
}
};
export function generateTestContent(type: 'product' | 'service' | 'case' | 'news') {
const timestamp = Date.now();
return {
type,
title: `测试${type}-${timestamp}`,
slug: `test-${type}-${timestamp}`,
content: `${type}内容描述-${timestamp}`,
excerpt: `${type}摘要-${timestamp}`
};
}