Cucumber 是否可以生成只包含场景标题且没有步骤的html报告

Cucumber 是否可以生成只包含场景标题且没有步骤的html报告,cucumber,Cucumber,是否可以生成只包含场景标题且没有步骤的html报告 我希望通过电子邮件生成html报告,但我希望生成的报告中所有场景都只有标题,这样我的报告就不会太大,也不容易知道哪些场景失败了 我相信有人可能对此有解决办法。请大家分享一下,或者告诉我怎么做 提前感谢您需要构建自定义格式化程序。有关此操作的详细信息,请参阅 要隐藏这些步骤,可以创建一个自定义格式化程序,该格式化程序覆盖Html格式化程序的before\u step\u result和build\u step方法 如果您的支持文件夹使用以下内容创

是否可以生成只包含场景标题且没有步骤的html报告

我希望通过电子邮件生成html报告,但我希望生成的报告中所有场景都只有标题,这样我的报告就不会太大,也不容易知道哪些场景失败了

我相信有人可能对此有解决办法。请大家分享一下,或者告诉我怎么做


提前感谢

您需要构建自定义格式化程序。有关此操作的详细信息,请参阅

要隐藏这些步骤,可以创建一个自定义格式化程序,该格式化程序覆盖Html格式化程序的
before\u step\u result
build\u step
方法

如果您的支持文件夹使用以下内容创建.rb文件:

require 'cucumber/formatter/html'

module Cucumber
  module Formatter
    class HtmlStepless < Html
      def before_step_result(step_result)
        #TODO: What is this used for?
        @step_match = step_result.step_match
        @hide_this_step = true
        if step_result.exception
          if @exceptions.include?(step_result.exception)
            @hide_this_step = true
            return
          end
          @exceptions << step_result.exception
        end
        if step_result.status != :failed && @in_background ^ step_result.background
          @hide_this_step = true
          return
        end
        @status = step_result.status
        return if @hide_this_step
        set_scenario_color(step_result.status)
        @builder << "<li id='#{@step_id}' class='step #{step_result.status}'>"
      end

      def build_step(keyword, step_match, status)
        # Do nothing
      end

    end
  end
end

谢谢贾斯汀,我会试试这个解决方案。非常感谢
cucumber -f Cucumber::Formatter::HtmlStepless -o output.htm