Crystal reports 带有失败步骤屏幕截图的Cypress BDD html报告

Crystal reports 带有失败步骤屏幕截图的Cypress BDD html报告,crystal-reports,cypress,bdd,cypress-cucumber-preprocessor,Crystal Reports,Cypress,Bdd,Cypress Cucumber Preprocessor,我想为我在cypress中的BDD测试附上html报告中失败步骤的屏幕截图 我正在使用“multiple Cumber html reporter”,并且我能够生成所有测试用例的BDD报告 下面是生成html报告的.js文件: const report = require("multiple-cucumber-html-reporter"); report.generate({ jsonDir: "cypress/reports", // ** Path

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

我正在使用“multiple Cumber 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插件报告中,我们不能像在cucumber中那样处理scenario对象


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

Cypress本身会自动截图失败的场景。截图应该没有问题。请参阅:但是如果您想将SS附加到html报告中,我建议您切换到Cypress的诱惑报告工具。请参见此处的详细信息和报告:

我找到了一个链接来实现我所需的功能,但我不确定该修复程序是否适用于pkugin或其他可以调整我的项目存储库的东西。我只想强调一下,您需要安装openJDK才能运行诱惑。谢谢@Celoaga。诱惑报告对我起了作用。我刚刚下载了2个插件,即。“Allure命令行”和“cypress Allure插件”。如果我在cypress.json的env参数中添加Allure=true。我还需要在命令行中传递env变量吗?不,不需要。