0

我想为我在柏树中的 BDD 测试附上 html 报告中失败步骤的屏幕截图。

我正在使用“multiple-cucumber-html-reporter”,并且能够生成所有测试用例的 BDD 报告。

下面是我生成 html 报告的 .js 文件:

const report = require("multiple-cucumber-html-reporter");
report.generate({
jsonDir: "cypress/reports",  // ** Path of .json file **//
reportPath: "./cypress/reports/cucumber-htmlreport.html",
metadata: {
browser: {
name: "chrome",
version: "81",
},
device: "Local test machine",
platform: {
name: "mac",
version: "Catalina",
},
},
});

我知道在 cypress 的 BDD html 报告插件中,我们不能像以前在黄瓜中那样使用场景对象。

如何在此处添加截屏代码?

4

1 回答 1

1

赛普拉斯本身会自动截取失败场景的屏幕截图。截图应该没有问题。请参阅:文档但如果您打算将 SS 附加到 html 报告中,我建议您切换到赛普拉斯的 Allure 报告工具。在此处查看详细信息和报告:魅力报告

于 2021-02-22T13:32:48.080 回答