Is there a cucumber hook to run before and after each feature

前端 未结 6 751
后悔当初
后悔当初 2020-12-10 04:39

Is there a way to run specific code block before and after each cucumber feature with certain tag?

Since setup process is very expensive I don\'t want to run it bef

6条回答
  •  既然无缘
    2020-12-10 05:03

    The hooks for cucumber are described in this wiki page which show the before and after hooks you can have.

    Taken from that page is this example:

    The following example will cause scenarios tagged with @fast to fail if the execution takes longer than 0.5 seconds:

    Around('@fast') do |scenario, block|
      Timeout.timeout(0.5) do
        block.call
      end
    end
    

提交回复
热议问题