简体   繁体   English

无法用诱惑力/红宝石黄瓜产生结果

[英]Unable to generate results with allure / ruby cucumber

I have been working on a new auto framework in ruby, but I am unable to get allure reporting results created, I have tried various different things but ultimately end up with the following errors: 我一直在使用ruby开发新的自动框架,但是无法获得诱人的报告结果,我尝试了各种不同的方法,但最终出现以下错误:

DevTools listening on ws://127.0.0.1:12177/devtools/browser/498a65da-7ba2-4387-8243-8d0e5be0424e

WARNING: The formatter AllureCucumber::Formatter is using the deprecated formatter API which will be removed in v4.0 of Cucumber.

undefined method 'name' for #<Cucumber::Core::Test::Step:0x00000000059673a0> (No MethodError)

C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/allure-cucumber-0.5.8/lib/allure-cucumber/formatter.rb:121:in 'after_test_step'

C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/ignore_missing_messages.rb:11:in 'method_missing'

C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/legacy_api/adapter.rb:32:in 'block in initialize'

I have followed the documentation and have good experience using the reporting with java, is it likely my version of cucumber is unsupported? 我已经阅读了文档,并且在使用Java进行报告方面拥有丰富的经验,是否可能不支持我的黄瓜版本? At best I can get an empty results directory created but the cucumber tests always error out with the above message. 充其量我可以创建一个空的结果目录,但是上述消息总是导致黄瓜测试出错。

This post is 8 months old so hopefully you got it worked out, but incase anyone else lands here, you can patch the cucumber-ruby gem with the following to get your tests to pass: 这篇文章成立8个月了,希望您能解决这个问题,但是如果其他人落在这里,您可以使用以下内容修补黄瓜红宝石,以使测试通过:

class Cucumber::Core::Test::Step
  def name
    return text if self.text == 'Before hook'
    return text if self.text == 'After hook'
    "#{source.last.keyword}#{text}"
  end
end 

The warning about API depreciation past 4.0 will remain, though. 不过,有关API折旧超过4.0的警告将保留。 Hopefully it will be fixed before then: https://github.com/allure-framework/allure-cucumber/issues/63 希望它将在此之前修复: https : //github.com/allure-framework/allure-cucumber/issues/63

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

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