describe('隆基系统全部页面验证', () => { // 在所有测试开始前清除localStorage beforeEach(() => { // 清除localStorage cy.window().then((win) => { win.localStorage.clear(); }); }); // 每个测试用例结束后清理内存 afterEach(() => { cleanupMemory(); }); // 创建通用对话框模板函数 const createDialogTemplate = (options) => { const { dialogClass, title, width, bodyContent, footerContent } = options; return `
测试环境: ' + environment + '
\n'; htmlReport += '总页面数: ' + combinedReport.pages.length + '
\n'; htmlReport += '总Tab页数: ' + testReport.summary.totalTabs + '
\n'; htmlReport += '失败页面数: ' + combinedReport.failedPages.length + '
\n'; htmlReport += '开始时间: ' + testReport.summary.startTime + '
\n'; htmlReport += '结束时间: ' + testReport.summary.endTime + '
\n'; htmlReport += '总耗时: ' + calculateDuration(new Date(testReport.summary.startTime), new Date(testReport.summary.endTime)) + '秒
\n'; htmlReport += '失败时间: ' + page.time + '
\n'; htmlReport += '错误信息: ' + page.error + '
\n'; htmlReport += '耗时: ' + page.duration + '秒
\n'; htmlReport += '| 页面名称 | \n'; htmlReport += '开始时间 | \n'; htmlReport += 'Tab页名称 | \n'; htmlReport += 'Tab开始时间 | \n'; htmlReport += 'Tab结束时间 | \n'; htmlReport += '加载时长(秒) | \n'; htmlReport += '状态 | \n'; htmlReport += '
|---|---|---|---|---|---|---|
| ' + page.name + ' | \n'; htmlReport += '' + page.startTime + ' | \n'; htmlReport += '无Tab页 | \n'; htmlReport += '||||
| ' + (j === 0 ? page.name : '') + ' | \n'; htmlReport += '' + (j === 0 ? page.startTime : '') + ' | \n'; htmlReport += '' + tab.name + ' | \n'; htmlReport += '' + tab.startTime + ' | \n'; htmlReport += '' + tab.endTime + ' | \n'; htmlReport += '' + tab.duration + ' | \n'; htmlReport += '' + tab.status + ' | \n'; htmlReport += '
测试报告已生成完成!
报告目录:
${reportDir}
报告文件:
${reportFile}