thoughtbot / capybara-webkit

A Capybara driver for headless WebKit to test JavaScript web apps
https://thoughtbot.com/open-source
MIT License
1.97k stars 428 forks source link

How to disable deprecation warnings? #1027

Closed TiSer closed 6 years ago

TiSer commented 6 years ago

I have a lot of messages [DEPRECATION] Capybara::Webkit::Driver#browser is deprecated.. But I still need to use #browser in my app. How can I get rid of this deprecation warnings?

jferris commented 6 years ago

This was deprecated because it was an accidentally-leaked internal detail, and our plan is to remove it eventually. I wouldn't depend on it, because we may refactor in ways that break every method on browser.

What is it you're using from browser?

TiSer commented 6 years ago

@jferris I'm using #set_skip_image_loading, #allow_unknown_urls and #url_blacklist. Yes, I know that all this should be replaced to "config" within Capybara::Webkit.configure, but in my application the amount of patches on capybara integration is so huge, that I can't do it for now and forced to use old syntax and functionality.

jferris commented 6 years ago

I'm going to close this, as it doesn't seem like we want to change anything in capybara-webkit.

In Ruby, you can always hack around something like this, for example using driver.instance_variable_get("@browser"). That will definitely get you in trouble eventually, though!