首页 > 解决方案 > 是否可以生成将在文件名中使用的浏览器名称?

问题描述

我需要将使用过的浏览器的名称放在 nightwatch-html-reporter 中的“reportFilename”中。

这意味着:当测试结束时,文件名将是这样的:firefox_1559642651723

我从安装中检查了 Nightwatch 中构建的 xml 报告器。xml 报告器自动在文件中显示浏览器的名称,我想在 nightwatch-html-reporter 中显示类似的内容

对不起我的英语不好。如果需要更多信息,请告诉我,我会尝试添加更多

var reporter = new HtmlReporter({
    openBrowser: false,
    themeName: 'default',
    reportsDirectory: __dirname + '/reports',
    reportFilename: "thereHaveToBeNameOfBrowserNameLikeFirefox_",
    uniqueFilename: true
});
module.exports = {
    reporter: reporter.fn

};

When i run the test like this:
nightwatch --test tests\folder\nameOfScript --e chrome

I expect that the browser name chrome will be added to the reportFilename

标签: javascriptreportnightwatch.jsnightwatch

解决方案


推荐阅读