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

Make click_with_javascript_emulation take any args #4

Merged
merged 1 commit into from
Apr 20, 2018

Conversation

radar
Copy link

@radar radar commented Apr 19, 2018

During the "Delete Widgets" test, this happens:

When I follow "Destroy"                 # features/step_definitions/web_steps.rb:48
  wrong number of arguments (given 2, expected 0) (ArgumentError)
  /Users/ryanbigg/code/gems/cucumber-rails/lib/cucumber/rails/capybara/javascript_emulation.rb:12:in `click_with_javascript_emulation'
  /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/node/element.rb:133:in `block in click'
  /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/node/base.rb:83:in `synchronize'
  /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/node/element.rb:133:in `click'
  /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/node/actions.rb:41:in `click_link'
  /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/session.rb:740:in `block (2 levels) in <class:Session>'
  /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
  /Users/ryanbigg/code/gems/cucumber-rails/tmp/aruba/test_app/features/step_definitions/web_steps.rb:49:in `block in <main>'

This is because Capybara 3 now passes two additional arguments to
Cucumber's method. But this Cucumber method needs to do nothing with
those arguments other than accept them.

This will make the "Deleting a widget" test pass once again.

You can see a shorter version of this same stacktrace during my fork's travis build: https://travis-ci.org/radar/cucumber-rails/jobs/368489987#L1024

During the "Delete Widgets" test, this happens:

    When I follow "Destroy"                 # features/step_definitions/web_steps.rb:48
      wrong number of arguments (given 2, expected 0) (ArgumentError)
      /Users/ryanbigg/code/gems/cucumber-rails/lib/cucumber/rails/capybara/javascript_emulation.rb:12:in `click_with_javascript_emulation'
      /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/node/element.rb:133:in `block in click'
      /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/node/base.rb:83:in `synchronize'
      /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/node/element.rb:133:in `click'
      /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/node/actions.rb:41:in `click_link'
      /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/session.rb:740:in `block (2 levels) in <class:Session>'
      /usr/local/Cellar/asdf/0.4.1/installs/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-3.0.2/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
      /Users/ryanbigg/code/gems/cucumber-rails/tmp/aruba/test_app/features/step_definitions/web_steps.rb:49:in `block in <main>'

  This is because Capybara 3 now passes two additional arguments to
  Cucumber's method. But this Cucumber method needs to do nothing with
  those arguments other than accept them.

  This will make the "Deleting a widget" test pass once again.
@radar radar force-pushed the click-with-js-emulation-args branch from 1eb7267 to 286f37f Compare April 19, 2018 06:32
@gobijan gobijan merged commit 4763fde into gobijan:master Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants