【问题标题】:How to get the steps list of a Cucumber scenario with Cucumber 1.3.17?如何使用 Cucumber 1.3.17 获取 Cucumber 场景的步骤列表?
【发布时间】:2015-03-03 03:22:51
【问题描述】:

我有一个 AfterStep 的 Hook,它与旧版本的 Cucumber 完美配合。

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

现在的问题是新的 Scenario 类 (Cucumber::Ast::Facade::Scenario) 没有将步骤列表作为公共变量。

在这个新版本中,如何获取 AfterStep 挂钩上的步骤列表(并了解当前步骤)?

谢谢你:)

【问题讨论】:

    标签: ruby cucumber hook


    【解决方案1】:

    Cucumber 1.3.19 传递了一个 Cucumber::Ast::Scenario 而不是外观版本。但是步骤集合中的步骤对象没有实现“currently_active”。

    【讨论】:

    • 那么,有没有办法可以像以前的版本一样做? :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-25
    • 1970-01-01
    • 2021-06-07
    • 1970-01-01
    • 2014-01-01
    • 2021-07-22
    相关资源
    最近更新 更多