由protractor-jasmine2-screenshot-reporter生成的Html报告中缺少表格显示

时间:2016-09-23 14:30:08

标签: html protractor jasmine2.0

当我使用protractor-jasmine2-screenshot-reporter运行我的测试以生成html报告时,我的报告会以非表格格式创建:

报告

摘要

测试的总规格:1 总失败:0 angularjs主页待办事项列表(4 s)

✓应添加待办事项(4 s) 切换配置

如何创建一个更好的报告,其中显示包含所有结果的表格?

这是我的conf.js文件:

 var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-  
 reporter');
 var reporter = new HtmlScreenshotReporter({
 dest: 'report-screenshots'
 , filename: 'my-report.html'

 });

 exports.config = {

 directConnect: true, //seleniumAddress: 'http://localhost:4444/wd/hub',
 capabilities: {
'browserName': 'chrome'
 }
, framework: 'jasmine'
, specs: ['todo-spec.js']
, allScriptsTimeout: 180000
, getPageTimeout: 180000
, jasmineNodeOpts: {
defaultTimeoutInterval: 180000
},

// Setup the report before any tests start
beforeLaunch: function () {
return new Promise(function (resolve) {
    reporter.beforeLaunch(resolve);
}); 
},

// Close the report after all tests finish
afterLaunch: function (exitCode) {
return new Promise(function (resolve) {
    reporter.afterLaunch(resolve.bind(this, exitCode));
});
}
, onPrepare: function () {
var width = 1300;
var height = 1200;
browser.driver.manage().window().setSize(width, height);
jasmine.getEnv().addReporter(reporter);
afterAll(function (done) {
    process.nextTick(done);
})
}
};

非常感谢,

1 个答案:

答案 0 :(得分:0)

我不认为protractor-jasmine2-screenshot-reporter会以您期望的格式生成报告

我刚检查并按预期生成以下格式。模板在index.js - protractor-jasmine2-screenshot-reporter中定义,并且不会生成表格报告。

enter image description here

如果要自定义,请更改模板here。我个人推荐protractor-html-screenshot-reporter