1、 软件环境说明
操作系统 |
软件 |
windows 7 |
JDK1.8 |
allure-2.13.0 |
2、安装allure
1、allure为免安装包,从官网上下载并解压到指定文件夹;
2、同Java一样配置环境变量;
3、检查allure是否安装成功:allure --version。
3、配置Junit报告
确保cypress.json已配置报告存放的信息(一个***.spec.js文件会对应生产一份报告)
{
"reporter": "junit",
"reporterOptions": {
"mochaFile": "results/test_report_[hash].xml",
"toConsole": true
}
}
或者使用命令行运行时指定配置信息
cypress run --reporter junit --reporter-options "mochaFile=results/test_report_[hash].xml,toConsole=true"
4、运行项目生成xml报告
cypress run --browser chrome
执行步骤会在控制台上打印,每个脚本运行后,都会有个小结 :共多少&