File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed 
lib/selenium/webdriver/common 
sig/lib/selenium/webdriver/common 
spec/integration/selenium/webdriver Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1313GEM 
1414  remote:  https://rubygems.org/ 
1515  specs: 
16-     activesupport  (8.0.0 )
16+     activesupport  (7.2.2 )
1717      base64 
1818      benchmark  (>=  0.3 )
1919      bigdecimal 
2525      minitest  (>=  5.1 )
2626      securerandom  (>=  0.3 )
2727      tzinfo  (~>  2.0 , >=  2.0.5 )
28-       uri  (>=  0.13.1 )
2928    addressable  (2.8.7 )
3029      public_suffix  (>=  2.0.2 , <  7.0 )
3130    ast  (2.4.2 )
162161    tzinfo  (2.0.6 )
163162      concurrent-ruby  (~>  1.0 )
164163    unicode-display_width  (2.6.0 )
165-     uri  (1.0.2 )
166164    webmock  (3.24.0 )
167165      addressable  (>=  2.8.0 )
168166      crack  (>=  0.3.2 )
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ def add_cookie(opts = {})
6565      # Get the cookie with the given name 
6666      # 
6767      # @param [String] name the name of the cookie 
68-       # @return [Hash, nil] the cookie, or nil  if it wasn't found. 
68+       # @return [Hash, nil] the cookie, or throws a NoSuchCookieError  if it wasn't found. 
6969      # 
7070
7171      def  cookie_named ( name ) 
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ module Selenium
1111
1212      def  add_cookie untyped ] opts) -> void 
1313
14-       def  cookie_named untyped ]
14+       def  cookie_named ( Hash[Symbol, untyped ] | Error::NoSuchCookieError) 
1515
1616      def  delete_cookie 
1717
@@ -33,7 +33,7 @@ module Selenium
3333
3434      def  strip_port 
3535
36-       def  convert_cookie Hash[ String,  untyped ] cookie ) -> Hash[Symbol, untyped ]
36+       def  convert_cookie ( Hash[Symbol, untyped ] | Error::NoSuchCookieError) 
3737    end 
3838  end 
3939end 
Original file line number Diff line number Diff line change @@ -248,6 +248,11 @@ module WebDriver
248248          driver . manage . delete_all_cookies 
249249          expect ( driver . manage . all_cookies ) . to  be_empty 
250250        end 
251+ 
252+         it  'throws error when fetching non-existent cookie'  do 
253+           expect  {  driver . manage . cookie_named ( 'non-existent' )  } 
254+             . to  raise_exception ( Error ::NoSuchCookieError ) 
255+         end 
251256      end 
252257    end  # Options 
253258  end  # WebDriver 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments