赛普拉斯 BDD html 报告以及失败步骤的屏幕截图

问题描述

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

我正在使用“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 报告插件中,我们不能像以前在黄瓜中那样使用场景对象。

如何在此处添加用于截取屏幕截图的代码?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)