Closed ckundo closed 6 years ago
Quick question -- any reason you're running such an old capybara-webkit (the issue is still in the current release - although probably wouldn't show up if using the current Capybara APIs). v 1.1.0 was released in 2013.
Seems like a refactor to me, @ckundo. Go ahead and send a PR. As soon as Ruby removes Fixnum, this will test itself!
This issue is still present with version 1.14.0, and the culprit is in this line.
The error:
/usr/lib/ruby/gems/2.4.0/gems/capybara-webkit-1.14.0/lib/capybara/webkit/browser.rb:87: warning: constant ::Fixnum is deprecated
As triggered by this cucumber stepdef:
Then(/^(?:the )?iframe should contain "([^"]*)" (?:selector|element)$/) do |selector|
expect(page).to have_selector 'iframe'
within_frame find('iframe') do
expect(page).to have_selector selector
end
end
Fixed in master
We're running into a deprecation warning running our tests with capybara-webkit, using Ruby 2.4.0:
The warning is raised when calling
page.driver.browser.frame_focus
without any arguments. The call toFixnum
is here: https://github.com/thoughtbot/capybara-webkit/blob/master/lib/capybara/webkit/browser.rb#L87.Fixnum
andBignum
were deprecated with the release of Ruby 2.4.0, in favor ofInteger
, as announced here: https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/Here's the new function that doesn't throw a deprecation warning:
Happy to open a PR, but first wanted to know if/how we can drive out the implementation with a test.