Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying step timing using "cucumber -f usage" fails #185

Closed
lnorr opened this issue Mar 8, 2018 · 4 comments
Closed

Displaying step timing using "cucumber -f usage" fails #185

lnorr opened this issue Mar 8, 2018 · 4 comments
Labels

Comments

@lnorr
Copy link

lnorr commented Mar 8, 2018

Summary

Displaying step timing using "cucumber -f usage" fails with error. Running regular "cucumber" succeeds.

Expected Behavior

Running "cucumber -f usage" on step definitions written using cucumber-ruby backend succeeds and shows the timing information (at the beginning of each step).

Current Behavior

This is the output with error that I see:

$ cucumber -f usage
undefined method `expression' for #<Cucumber::Wire::StepDefinition:0x007f814592a770> (NoMethodError)
/Library/Ruby/Gems/2.3.0/gems/cucumber-3.0.1/lib/cucumber/formatter/usage.rb:42:in `on_test_step_finished'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/event_bus.rb:34:in `block in broadcast'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/event_bus.rb:34:in `each'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/event_bus.rb:34:in `broadcast'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/event_bus.rb:40:in `method_missing'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/runner.rb:35:in `around_hook'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/around_hook.rb:12:in `describe_to'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:120:in `block (2 levels) in compose_around_hooks'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:121:in `compose_around_hooks'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:26:in `block in describe_to'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/runner.rb:19:in `test_case'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
/Library/Ruby/Gems/2.3.0/gems/cucumber-3.0.1/lib/cucumber/filters/prepare_world.rb:12:in `test_case'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:57:in `test_case'
/Library/Ruby/Gems/2.3.0/gems/cucumber-3.0.1/lib/cucumber/filters/retry.rb:18:in `test_case'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
/Library/Ruby/Gems/2.3.0/gems/cucumber-3.0.1/lib/cucumber/filters/quit.rb:12:in `test_case'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
/Library/Ruby/Gems/2.3.0/gems/cucumber-3.0.1/lib/cucumber/filters/broadcast_test_run_started_event.rb:20:in `block in done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-3.0.1/lib/cucumber/filters/broadcast_test_run_started_event.rb:19:in `map'
/Library/Ruby/Gems/2.3.0/gems/cucumber-3.0.1/lib/cucumber/filters/broadcast_test_run_started_event.rb:19:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/filters/locations_filter.rb:20:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/filters/tag_filter.rb:18:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/compiler.rb:24:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core/gherkin/parser.rb:37:in `done'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core.rb:32:in `parse'
/Library/Ruby/Gems/2.3.0/gems/cucumber-core-3.0.0/lib/cucumber/core.rb:21:in `compile'
/Library/Ruby/Gems/2.3.0/gems/cucumber-3.0.1/lib/cucumber/runtime.rb:74:in `run!'
/Library/Ruby/Gems/2.3.0/gems/cucumber-3.0.1/lib/cucumber/cli/main.rb:33:in `execute!'
/Library/Ruby/Gems/2.3.0/gems/cucumber-3.0.1/bin/cucumber:9:in `<top (required)>'
/usr/local/bin/cucumber:22:in `load'
/usr/local/bin/cucumber:22:in `<main>'

Steps to Reproduce (for bugs)

  • Build the sample steps on Cucumber-cpp.
  • Execute the test.
  • Run "cucumber -f usage" in a separate window or process.

Your Environment

  • Version used: 0.4
  • Operating System and version: macOS 10.13
  • Link to your project: internal but also reproduced on samples
@konserw
Copy link
Contributor

konserw commented Apr 2, 2018

Hi,
I can't reproduce your error with my linux machine. Commands I've used:

build/examples/Calc/GTestCalculatorSteps >/dev/null &
cucumber -f usage examples/Calc

Cucumber output:

----................

0.0000693 ^I press divide                               # CalculatorSteps.cpp:25
  0.0000693 When I press divide                         # examples/Calc/features/division.feature:9
0.0000688 ^the result should be (.*) on the screen$     # CalculatorSteps.cpp:31
  0.0000688 Then the result should be 1.5 on the screen # examples/Calc/features/division.feature:10
0.0000672 ^I have entered (\d+) into the calculator$    # CalculatorSteps.cpp:12
  0.0000646 Given I have entered 3 into the calculator  # examples/Calc/features/division.feature:7
  0.0000697 And I have entered 2 into the calculator    # examples/Calc/features/division.feature:8

4 scenarios (4 passed)
16 steps (16 passed)
0m0.072s
[1]+  Done                    build/examples/Calc/GTestCalculatorSteps > /dev/null

And it the same no meter if I run cucumber from the same windows or separate.
Could you retest with latest cucumber-cpp?
If bug is still reproducible for you could you please provide exact commands you are using and your environment (i.e. version of cucumber, gtest or boost etc.)?

@konserw
Copy link
Contributor

konserw commented Apr 2, 2018

Ok I've reproduced your problem after upgrading to cucumber 3.x. I'm not sure how to fix this issue, but for time being you can work-around it by downgrading your cucumber to 2.x

@lnorr
Copy link
Author

lnorr commented Apr 2, 2018

Ah, thanks. I've downgraded to Cucumber 2.0.0 and that works. Note that I'm experiencing similar issues with versions higher than Cucumber 2.1.0. For completeness, here are the versions that work for me with "cucumber -f usage":
$ gem list cucumber
cucumber (2.0.0)
cucumber-core (1.1.3)
cucumber-wire (0.0.1)
$ gem list gherkin
gherkin (2.12.2)

@mattwynne
Copy link
Member

As of cucumber/cucumber-ruby-wire#14 this should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants