如何在黄瓜报告中添加选项以删除具有一定标签的方案

发布于 2025-01-31 20:16:14 字数 549 浏览 3 评论 0 原文

我想在Cucumber报告中有一个选项,以使用结果和数字的给定标签静音/隐藏方案。

我们有一个竹制建筑,可以运行我们的空手道存储库的功能和场景。最后,它产生了不错的黄瓜HTML报告。在“概述 - features.html”上,我想在右上方添加一个选项,其中包括“功能”,“标签”,“步骤”和“失败”,那就是“排除失败”或类似的东西。当单击时,提供了与概述 - 版本的相同的确切信息。

为什么我需要这个。我们有一些现有的场景失败。由于我们自己的软件中的缺陷,它们失败了,这可能在6个月到一年的时间内无法修复。我们已经用指定的标签标记了它们,“@bug = abc-12345”。我希望它们从竹制末端为空手道末端产生的黄瓜报告中被静音/排除在外,这样我就可以快速查看经过的功能/场景的数量,看看它是否100%。如果是这样,那么构建很好。如果没有,我需要进一步研究它,因为我们似乎有一些回归。如果没有这些方案的预期失败,并将继续失败,直到解决后,请浏览所有单个功能文件报告并查看失败的方案,然后查看原因是非常乏味和耗时的。我不希望它们完全删除,因为当它们开始通过时,我需要知道,所以我可以回去从场景中删除标签。

关于如何实现这一目标的任何想法?

I want to have an option on the cucumber report to mute/hide scenarios with a given tag from the results and numbers.

We have a bamboo build that runs our karate repository of features and scenarios. At the end it produces nice cucumber html reports. On the "overview-features.html" I would like to have an option added to the top right, which includes "Features", "Tags", "Steps" and "Failures", that says "Excluded Fails" or something like that. That when clicked provides the same exact information that the overview-features.html does, except that any scenario that's tagged with a special tag, for example @bug=abc-12345, is removed from the report and excluded from the numbers.

Why I need this. We have some existing scenarios that fail. They fail due to defects in our own software, that might not get fixed for 6 months to a year. We've tagged them with a specified tag, "@bug=abc-12345". I want them muted/excluded from the cucumber report that's produced at the end of the bamboo build for karate so I can quickly look at the number of passed features/scenarios and see if it's 100% or not. If it is, great that build is good. If not, I need to look into it further as we appear to have some regression. Without these scenarios that are expected to fail, and continue to fail until they're resolved, it is very tedious and time consuming to go through all the individual feature file reports and look at the failing scenarios and then look into why. I don't want them removed completely as when they start to pass I need to know so I can go back and remove the tag from the scenario.

Any ideas on how to accomplish this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

念﹏祤嫣 2025-02-07 20:16:14

空手道1.0对报告系统进行了大修,并进行了以下关键更改。

  • Runner 完成后,您可以按摩结果,甚至可以重新尝试一些测试,
  • 您可以注入自定义的HTML报告渲染器,

这将需要您介绍详细信息(其中一些尚未记录在案)和编写一些Java代码。如果这不是一个选择,则必须考虑到您的要求是空手道不支持的。

如果您愿意走这条路,这是您需要开始的链接。

a)呈现报告之前如何“发布过程”结果数据的示例: retrytest.java ,另请参见 https://stackoverflow.com/a/a/67971681/143475

b)b)负责“可插拔”报告的代码,您可以在其中实现新的 suetereports < /a>理论上。在 Runner 中,有一个 suitereports()您可以调用以提供您的实现。

另请注意,有一个实验性的“ DOC”关键字,您可以将自定义的HTML注入测试报告: https://twitter.com/getkarate/status/133889292932691070976

另请参见:

Karate 1.0 has overhauled the reporting system with the following key changes.

  • after the Runner completes you can massage the results and even re-try some tests
  • you can inject a custom HTML report renderer

This will require you to get into the details (some of this is not documented yet) and write some Java code. If that is not an option, you have to consider that what you are asking for is not supported by Karate.

If you are willing to go down that path, here are the links you need to get started.

a) Example of how to "post process" result-data before rendering a report: RetryTest.java and also see https://stackoverflow.com/a/67971681/143475

b) The code responsible for "pluggable" reports, where you can implement a new SuiteReports in theory. And in the Runner, there is a suiteReports() method you can call to provide your implementation.

Also note that there is an experimental "doc" keyword, by which you can inject custom HTML into a test-report: https://twitter.com/getkarate/status/1338892932691070976

Also see: https://twitter.com/KarateDSL/status/1427638609578967047

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文