简体   繁体   English

如何使用Cucumber 1.3.17获取Cucumber场景的步骤列表?

[英]How to get the steps list of a Cucumber scenario with Cucumber 1.3.17?

I have a Hook of an AfterStep that was working perfectly with an older version of Cucumber. 我有一个AfterStep挂钩,可以与较旧版本的Cucumber完美配合。

AfterStep do |scenario|
  scenario.steps.each do |step|
     puts "This is the step #{step.name}" unless !step.currently_active
  end
end

The problem now is that the new Scenario class ( Cucumber::Ast::Facade::Scenario ) doesn't have the steps list as a public variable. 现在的问题是,新的Scenario类( Cucumber :: Ast :: Facade :: Scenario )没有将步骤列表作为公共变量。

How can I get a list of the steps (and to know the current one) on an AfterStep hook, in this new version? 在这个新版本中,如何获取AfterStep挂钩上的步骤列表(并了解当前步骤)?

Thank you :) 谢谢 :)

Cucumber 1.3.19 passes a Cucumber::Ast::Scenario not the facade version. 黄瓜1.3.19传递了Cucumber :: Ast :: Scenario而不是Facade版本。 However the step objects in the step collection do not implement "currently_active". 但是,步骤集合中的步骤对象未实现“ currently_active”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM