[rb] Add tests for the cookie named, and updates type#14843
[rb] Add tests for the cookie named, and updates type#14843aguspe merged 2 commits intoSeleniumHQ:trunkfrom
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
* add tests for the cookie named, and updates type * update gemfile lock
User description
Description
This PR adds a test to validate that the cookie-named method can throw an error as the specification for get_cookie which is used in the cookie_named method states https://www.w3.org/TR/webdriver1/#get-named-cookie.
It also updates the RBS files and the doc comment to match the expected behavior.
Motivation and Context
All of our users need to understand the expected behavior of the methods, and that the return types, matched that expected behavior.
Thank you so much @luke-hill for raising this up.
Types of changes
Checklist
PR Type
Tests, Enhancement
Description
cookie_namedmethod throwsNoSuchCookieErrorwhen a non-existent cookie is requested.cookie_namedmethod to reflect the error handling behavior.Error::NoSuchCookieErroras a possible return type forcookie_named.Changes walkthrough 📝
manager.rb
Update doc comment for `cookie_named` methodrb/lib/selenium/webdriver/common/manager.rb
cookie_namedmethod.cookie_namedthrowsNoSuchCookieErrorif the cookie isnot found.
manager_spec.rb
Add test for `cookie_named` error handlingrb/spec/integration/selenium/webdriver/manager_spec.rb
cookie_namedmethod.NoSuchCookieErrorwhen cookie is not found.manager.rbs
Update type signature for `cookie_named` methodrb/sig/lib/selenium/webdriver/common/manager.rbs
cookie_namedmethod.Error::NoSuchCookieErrorin return type.