Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions rb/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (8.0.0)
activesupport (7.2.2)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -25,7 +25,6 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
Expand Down Expand Up @@ -162,7 +161,6 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
uri (1.0.2)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand Down
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/common/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def add_cookie(opts = {})
# Get the cookie with the given name
#
# @param [String] name the name of the cookie
# @return [Hash, nil] the cookie, or nil if it wasn't found.
# @return [Hash, nil] the cookie, or throws a NoSuchCookieError if it wasn't found.
#

def cookie_named(name)
Expand Down
4 changes: 2 additions & 2 deletions rb/sig/lib/selenium/webdriver/common/manager.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Selenium

def add_cookie: (?Hash[Symbol, untyped] opts) -> void

def cookie_named: (String name) -> Hash[Symbol, untyped]
def cookie_named: (String name) -> (Hash[Symbol, untyped] | Error::NoSuchCookieError)

def delete_cookie: (String name) -> String

Expand All @@ -33,7 +33,7 @@ module Selenium

def strip_port: (String str) -> String?

def convert_cookie: (Hash[String, untyped] cookie) -> Hash[Symbol, untyped]
def convert_cookie: (String) -> (Hash[Symbol, untyped] | Error::NoSuchCookieError)
end
end
end
5 changes: 5 additions & 0 deletions rb/spec/integration/selenium/webdriver/manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ module WebDriver
driver.manage.delete_all_cookies
expect(driver.manage.all_cookies).to be_empty
end

it 'throws error when fetching non-existent cookie' do
expect { driver.manage.cookie_named('non-existent') }
.to raise_exception(Error::NoSuchCookieError)
end
end
end # Options
end # WebDriver
Expand Down
Loading