chore: 完成v1.0.0最终验收,更新测试报告与文档
新增CSP安全配置与对应测试用例,补充并发负载测试,更新README进度与统计数据,新增最终验收报告与测试计划文档,修复已知测试问题
This commit is contained in:
@@ -72,4 +72,26 @@ test.describe('安全验证 E2E 测试', () => {
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('TC-SEC-E2E-004: 内容安全策略 (CSP) 验证', () => {
|
||||
test('页面不应加载未知外部资源', async ({ page }) => {
|
||||
const requests: string[] = []
|
||||
page.on('request', request => {
|
||||
const url = request.url()
|
||||
// 允许本地资源、data URI 和 uni-app 框架已知 CDN 资源
|
||||
if (
|
||||
!url.startsWith('http://localhost') &&
|
||||
!url.startsWith('data:') &&
|
||||
!url.startsWith('https://cdn.dcloud.net.cn')
|
||||
) {
|
||||
requests.push(url)
|
||||
}
|
||||
})
|
||||
|
||||
await page.goto('/')
|
||||
await page.waitForLoadState('networkidle')
|
||||
|
||||
expect(requests).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user