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

前端 未结 6 756
后悔当初
后悔当初 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:05

    a modification of the first answer works for me with single quotes

        Before('@feature_with_expensive_setup') do
          unless '@setup_is_done'
            # perform expensive setup code here ..
            @setup_is_done = true
          end
        end
    

提交回复
热议问题