Kirinfm / Kirinfm.github.io

About Kirinfm
https://kirinfm.github.io/
0 stars 0 forks source link

Selenium IDE 构建自动化测试 #4

Open Kirinfm opened 5 years ago

Kirinfm commented 5 years ago

jest-html-reporters

jest-html-reporters 是一个基于 jest 生成 html 报表的工具

selenium-side-runner 的测试报告是基于 jest 进行实现的, 详见 index.js

由于官方未向外暴露出自定义配置 jest 属性,所以需要对 index.js#L204index.js#L211 进行处理。

增加属性

      jestConfiguration: { reporters: ['default', 'jest-junit', 
        ["jest-html-reporters", {
          "publicPath": `${outputDirectory}/html-report`,
          "filename": `${project.name}.html`,
          "expand": true
        }]] },

即可。

导出的报告样式如下: image