0

我在我的 React 应用程序中使用 cucumber js 创建 json 报告,我使用 multiple-cucumber-html-reporter 从 json 文件制作 html 报告。我需要为特定步骤添加屏幕截图,但我不知道如何在步骤定义中将嵌入添加到生成的 json 中。我搜索了很长时间,但没有找到任何东西。也许有人会知道如何编写一个函数来改变嵌入?

如果我的功能文件中有带有步骤的场景:

And I take a picture

在js步骤定义文件中我有:

And("I take a picture", () {
    cy.screenshot();
    //what can I do here to save the screenshot in json embeddings?
    //anyways anything like "this.attach()" or ".embed()" doesn't seem to work with cypress + cucumber.js
});
4

0 回答 0