Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

AllureCucumber::Formatter is using deprecated formatter API #63

Closed
1 of 3 tasks
vhsantos26 opened this issue Feb 9, 2018 · 9 comments
Closed
1 of 3 tasks

AllureCucumber::Formatter is using deprecated formatter API #63

vhsantos26 opened this issue Feb 9, 2018 · 9 comments

Comments

@vhsantos26
Copy link

I'm submitting a BUG

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

When I try to execute my features with AllureCucumber::Formater, cucumber generate a error about deprecated formatter API.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • Have a simple feature
  • Execute command: cucumber --formater AllureCucumber::Formatter --out /reports/
  • Getting a error:
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:0x000000000320b270> (NoMethodError)
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'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/event_bus.rb:34:in `block in broadcast'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/event_bus.rb:34:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/event_bus.rb:34:in `broadcast'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/event_bus.rb:40:in `method_missing'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/runner.rb:35:in `around_hook'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/around_hook.rb:12:in `describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:120:in `block (2 levels) in compose_around_hooks'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:121:in `compose_around_hooks'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:26:in `block in describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/runner.rb:19:in `test_case'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/prepare_world.rb:12:in `test_case'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:57:in `test_case'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/retry.rb:18:in `test_case'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/quit.rb:12:in `test_case'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/broadcast_test_run_started_event.rb:20:in `block in done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/broadcast_test_run_started_event.rb:19:in `map'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/broadcast_test_run_started_event.rb:19:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/filters/locations_filter.rb:20:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/filters/tag_filter.rb:18:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/compiler.rb:24:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/gherkin/parser.rb:37:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core.rb:32:in `parse'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core.rb:21:in `compile'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/runtime.rb:74:in `run!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/cli/main.rb:33:in `execute!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/bin/cucumber:9:in `<top (required)>'
C:/Ruby24-x64/bin/cucumber:23:in `load'
C:/Ruby24-x64/bin/cucumber:23:in `<main>'

What is the expected behavior?

All features running and generating allure results correct.

What is the motivation / use case for changing the behavior?

Allure-cucumber working with Cucumber last version.

Please tell us about your environment:

Allure version 2.5.0
ruby 2.4.3p205
cucumber 3.1.0
allure-report 0.5.8
@ndeztea
Copy link

ndeztea commented Feb 28, 2018

any update regarding this issue? I have simliar issue like this

undefined method `name' for #<Cucumber::Core::Test::Step:0x007ffed1aaffa0> (NoMethodError) /Users/happyfresh/.rvm/gems/ruby-2.4.1@happy-fresh-acceptance/gems/allure-cucumber-0.6.0/lib/allure-cucumber/formatter.rb:121:in `after_test_step' /

@baev baev mentioned this issue Mar 7, 2018
@Ilya-Shemanuev
Copy link

Ilya-Shemanuev commented Mar 16, 2018

I have the same problem. Execute command: same command.
I can't generate allure report.

ruby - 2.5.0
cucumber - 3.1.0
allure-cucumber - 0.6.0

In cucumber 4.0 formatter will be replaced? How I can generate allure-report for now?

@sk-jlewis
Copy link

Haven't thoroughly verified, but I put this monkey patch in my support/env.rb file if it helps anyone:

class Cucumber::Core::Test::Step
  def name
    text
  end
end

@vhsantos26
Copy link
Author

Hi @sk-jlewis ,

It's true, works for me too, but, did you have this problema on report?

image

In my case, the keywords Given, When and Then didn't appears on report.

@sk-jlewis
Copy link

Yes I also have that issue, I'll let you know if I produce anything today

@sk-jlewis
Copy link

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

This seems to work for me

screen shot 2018-04-19 at 1 35 49 pm

@vhsantos26
Copy link
Author

@sk-jlewis tks man, work for me too!

@SymphonicJohn
Copy link

The monkey patch works well enough for the missing name method, but the error:
'WARNING: The formatter AllureCucumber::Formatter is using the deprecated formatter API which will be removed in v4.0 of Cucumber.'
reamins.
Are there any plans to move away from the depreciated api calls?

@andrcuns
Copy link

This is solved in new adaptor implementation v2.13.0

@baev baev closed this as completed Oct 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants