Class: Capybara::Selenium::Driver
- Inherits:
-
Object
- Object
- Capybara::Selenium::Driver
- Defined in:
- lib/kimurai/capybara_ext/selenium/driver.rb
Instance Method Summary collapse
- #clear_cookies ⇒ Object
- #get_cookies ⇒ Object
- #pid ⇒ Object
- #port ⇒ Object
- #set_cookie(name, value, options = {}) ⇒ Object
- #set_cookies(cookies) ⇒ Object
Instance Method Details
#clear_cookies ⇒ Object
21 22 23 |
# File 'lib/kimurai/capybara_ext/selenium/driver.rb', line 21 def browser.manage. end |
#get_cookies ⇒ Object
4 5 6 |
# File 'lib/kimurai/capybara_ext/selenium/driver.rb', line 4 def browser.manage. end |
#pid ⇒ Object
27 28 29 |
# File 'lib/kimurai/capybara_ext/selenium/driver.rb', line 27 def pid @pid ||= `lsof -i tcp:#{port} -t`.strip.to_i end |
#port ⇒ Object
31 32 33 |
# File 'lib/kimurai/capybara_ext/selenium/driver.rb', line 31 def port @port ||= browser.send(:bridge).instance_variable_get("@http").instance_variable_get("@server_url").port end |
#set_cookie(name, value, options = {}) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/kimurai/capybara_ext/selenium/driver.rb', line 8 def (name, value, = {}) [:name] ||= name [:value] ||= value browser.manage.() end |
#set_cookies(cookies) ⇒ Object
15 16 17 18 19 |
# File 'lib/kimurai/capybara_ext/selenium/driver.rb', line 15 def () .each do || ([:name], [:value], ) end end |