-
-
Notifications
You must be signed in to change notification settings - Fork 427
Deprecation warning on normalize_whitespace with capybara >= 3.0 #1065
Comments
Had the same issue during a Rails 5.2 upgrade, tracking master removed the warnings. |
These warnings come in hundreds which is quite annoying. What's wrong with a patch release? |
Any news on this? |
Switching to the branch # Gemfile
group :test do
gem 'capybara-webkit', github: 'thoughtbot/capybara-webkit', branch: 'master'
end |
Any time frame on the next release? Much appreciated, thanks! |
After switching to the master branch of expected to find text "4 Total Users" in "4\nTotal\nUsers\n" (RSpec::Expectations::ExpectationNotMetError) I decided to switch back to capybara-webkit # features/support/capybara/helpers.rb
# or
# spec/support/capybara/helpers.rb
module Capybara
module Helpers
class << self
alias_method :normalize_whitespace_with_warning, :normalize_whitespace
def normalize_whitespace(*args)
silence_warnings do
normalize_whitespace_with_warning(*args)
end
end
end
end
end |
@Hirurg103 Those errors are because you've updated to Capybara 3 and the master branch of capybara-webkit properly supports Capybara 3 (whereas 1.15.0 does not). The details are in Capybaras upgrade guide - https://github.com/teamcapybara/capybara/blob/master/UPGRADING.md#node. Capybara 3.5.0 also adds a |
@twalpole with capybara 3.5.0 and capybara-webkit 1.15.0 I had the build green. But after switching to capybara-webkit master branch and leaving capybara version the same it started to fail with the spacing error above |
@Hirurg103 Yes. As I stated in my comment capybara-webkit 1.5.0 does not properly support Capybara 3. It doesn't meet the Capybara 3 requirements for returning the text of an element, whereas the master branch does. The errors you get about text matching when using the master branch are correct for Capybara 3 and would be returned if you use any of the other drivers which have released Capybara 3 compliant versions. |
@twalpole Before the upgrade I used capybara |
@Hirurg103 The breaking changes are from Capybara 2.x to Capybara 3.x as mentioned in the upgrade.md I linked previously - you just didn’t see them until using |
@twalpole thank you for the explanation! Now I see why my build still passing after upgrade to capybara 3 and capybara webkit 1.15. |
Here's the fix that worked for me (which @twalpole already mentioned above): Before After From my understanding, the |
@twalpole thanks a lot for the patience 😅 , I haven't read the Capybara upgrade guide for the first time properly |
For now, either: gem "capybara"
gem 'capybara-webkit', git: 'https://github.com/thoughtbot/capybara-webkit.git' or gem "capybara", '~>2.0'
gem 'capybara-webkit' |
Hi!
Since this commit on Capybara, first released with capybara 3.0.0.rc2, this deprecation warning is thrown:
This seems to be fixed on master in this commit. Any chance of a new release?
Thank you!
The text was updated successfully, but these errors were encountered: