capybara icon indicating copy to clipboard operation
capybara copied to clipboard

Remove calls to WebStorage JS methods, fixes #2772

Open bkleinen opened this issue 1 year ago • 7 comments

Removed calls to deprecated methods. See

https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES

4.24.0 (2024-08-23)

  • Deprecate WebStorage JS methods (#14276)

https://github.com/SeleniumHQ/selenium/pull/14276

https://github.com/SeleniumHQ/selenium/pull/14276/commits/fc6c070e713b02c8488850a0b7ae1d382a6275a6

bkleinen avatar Sep 02 '24 13:09 bkleinen

Issue: https://github.com/teamcapybara/capybara/issues/2772

bkleinen avatar Sep 02 '24 13:09 bkleinen

I might be wrong, but it seems that this is just deprecated to get an overview how to implement it more consistently https://github.com/SeleniumHQ/selenium/issues/10397#issuecomment-1236394300 and Motivation here https://github.com/SeleniumHQ/selenium/pull/14276.

So there will probably be a replacement before removal, so I don't feel like the functionality needs to be removed here. Removing the deprecation messages is possible with

Selenium::WebDriver.logger.ignore(:logger_info, :clear_local_storage, :clear_session_storage)

This is already required in selenium projects to get rid of the logger_info message

flugsio avatar Sep 06 '24 14:09 flugsio

From my understanding, Capybara already uses the replacement if the methods have been removed: if @browser.respond_to? :session_storage @browser.session_storage.clear else ... call js methods directly

-> thus, I see no need to wait for the actual removement of the methods, and think they can be removed already.

bkleinen avatar Sep 08 '24 16:09 bkleinen

Oh I see, I didn't fully read the capybara implementation :facepalm: ... Thanks for explaining it!

PR looks good to me :+1:

flugsio avatar Sep 09 '24 22:09 flugsio

👋 I am using this branch, and it's working great. Thanks for keeping my output readable!

olleolleolle avatar Oct 03 '24 07:10 olleolleolle

@bkleinen thanks for the great work here and thanks for all of the awesome work @twalpole. Is there anything the rest of us can do to help get this across the finish line?

wwahammy avatar Jan 09 '25 16:01 wwahammy

Are there any blockers getting this merged in?

sethhorsley avatar Jun 16 '25 11:06 sethhorsley