Class: Capybara::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/monkey-patches/capybara-patches.rb

Instance Method Summary collapse

Instance Method Details



75
76
77
# File 'lib/monkey-patches/capybara-patches.rb', line 75

def add_cookie(attribs)
  driver.add_cookie(attribs)
end

Get the cookie with the given name

Parameters:

  • name (String)

    the name of the cookie

Returns:

  • (Hash, nil)

    the cookie, or nil if it wasn’t found.



63
64
65
# File 'lib/monkey-patches/capybara-patches.rb', line 63

def cookie_named(name)    
  driver.cookie_named(name)
end

#cookiesArray<Hash>

Get all cookies

Returns:

  • (Array<Hash>)

    list of cookies



53
54
55
# File 'lib/monkey-patches/capybara-patches.rb', line 53

def cookies    
  driver.cookies
end

#delete_all_cookiesObject



71
72
73
# File 'lib/monkey-patches/capybara-patches.rb', line 71

def delete_all_cookies
  driver.delete_all_cookies
end


67
68
69
# File 'lib/monkey-patches/capybara-patches.rb', line 67

def delete_cookie(cookie)
  driver.delete_cookie(cookie)
end