Class: Capybara::Session

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

Instance Method Summary collapse

Instance Method Details



81
82
83
# File 'lib/monkey-patches/capybara-patches.rb', line 81

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.



69
70
71
# File 'lib/monkey-patches/capybara-patches.rb', line 69

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

#cookiesArray<Hash>

Get all cookies

Returns:

  • (Array<Hash>)

    list of cookies



59
60
61
# File 'lib/monkey-patches/capybara-patches.rb', line 59

def cookies    
  driver.cookies
end

#delete_all_cookiesObject



77
78
79
# File 'lib/monkey-patches/capybara-patches.rb', line 77

def delete_all_cookies
  driver.delete_all_cookies
end


73
74
75
# File 'lib/monkey-patches/capybara-patches.rb', line 73

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

#delete_cookies_in_domain(domain) ⇒ Object



85
86
87
# File 'lib/monkey-patches/capybara-patches.rb', line 85

def delete_cookies_in_domain(domain)
  driver.delete_cookies_in_domain(domain)
end