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

Step definitions with arguments fail with "No self_obj" #337

Closed
karlhe opened this Issue Mar 1, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@karlhe

karlhe commented Mar 1, 2018

Summary

Any cucumber step that matches with a step definition will error out with something similar to this:

    When I go to the root page                                # features/step_definitions/web_steps.rb:29
      No self_obj (RuntimeError)
      /Users/karlhe/.gem/gems/cucumber-expressions-5.0.13/lib/cucumber/cucumber_expressions/argument.rb:31:in `value'
      /Users/karlhe/.gem/gems/cucumber-3.1.0/lib/cucumber/step_match.rb:18:in `block in args'
      org/jruby/RubyArray.java:2487:in `map'
      /Users/karlhe/.gem/gems/cucumber-3.1.0/lib/cucumber/step_match.rb:17:in `args'
      /Users/karlhe/.gem/gems/cucumber-3.1.0/lib/cucumber/step_match.rb:97:in `deep_clone_args'
      /Users/karlhe/.gem/gems/cucumber-3.1.0/lib/cucumber/step_match.rb:29:in `invoke'
      /Users/karlhe/.gem/gems/cucumber-3.1.0/lib/cucumber/step_match.rb:24:in `block in activate'
      /Users/karlhe/.gem/gems/cucumber-core-3.1.0/lib/cucumber/core/test/action.rb:24:in `execute'
      /Users/karlhe/.gem/gems/cucumber-core-3.1.0/lib/cucumber/core/test/step.rb:32:in `execute'
      /Users/karlhe/.gem/gems/cucumber-core-3.1.0/lib/cucumber/core/test/runner.rb:104:in `execute'
      /Users/karlhe/.gem/gems/cucumber-core-3.1.0/lib/cucumber/core/test/runner.rb:51:in `execute'
      /Users/karlhe/.gem/gems/cucumber-core-3.1.0/lib/cucumber/core/test/runner.rb:27:in `test_step'
      /Users/karlhe/.gem/gems/cucumber-core-3.1.0/lib/cucumber/core/test/step.rb:17:in `describe_to'
      /Users/karlhe/.gem/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:28:in `block in describe_to'
      org/jruby/RubyArray.java:1735:in `each'
      /Users/karlhe/.gem/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:27:in `block in describe_to'

Step definition:

When(/^(?:|I )go to (.+)$/) do |page_name|
  visit path_to(page_name)
end

Started when I upgraded to 3.1.0, does not happen on cucumber-ruby 3.0.2.
Likely has something to do with 3.0.2 using cucumber-expressions-4.0.4, and 3.1.0 using cucumber-expressions-5.0.13

Uses a step definition with no arguments works without any issues.

Possibly related: https://stackoverflow.com/questions/47621315/no-self-obj-runtimeerror-cucumber-capybara-whenever-i-use-double-quotes-on-my

Your Environment

  • Version used: cucumber-ruby 3.1.0
  • Operating System and version: macOS 10.13.3
  • JRuby 9.1.16.0
@aslakhellesoy

This comment has been minimized.

Contributor

aslakhellesoy commented Mar 2, 2018

This issue was moved to cucumber/cucumber-ruby#1281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment