class Capybara::Selenium::Driver

Remove this monkey patch after fixing the bugs in selenium-webdriver / capybara :nocov:

Public Instance Methods

current_url() click to toggle source

Known issue, works differently for real browsers github.com/seleniumhq/selenium/issues/1727

# File lib/howitzer/web/capybara_methods_proxy.rb, line 18
def current_url
  return browser.current_url unless within_frame?

  execute_script('return document.location.href')
end
title() click to toggle source

github.com/teamcapybara/capybara/issues/1845

# File lib/howitzer/web/capybara_methods_proxy.rb, line 10
def title
  return browser.title unless within_frame?

  find_xpath('/html/head/title').map { |n| n[:text] }.first.to_s
end

Private Instance Methods

within_frame?() click to toggle source
# File lib/howitzer/web/capybara_methods_proxy.rb, line 26
def within_frame?
  !(@frame_handles.blank? || @frame_handles[browser.window_handle].blank?)
end