module CucumberSteps::WorldExtensions::BrowserMethods
Public Instance Methods
browser()
click to toggle source
# File lib/cucumber_steps/world_extensions/browser_methods.rb, line 5 def browser @browser || reopen_browser! end
browser_name()
click to toggle source
# File lib/cucumber_steps/world_extensions/browser_methods.rb, line 24 def browser_name CucumberSteps::ENVFetcher.browser_name || @browser_name || 'phantomjs' end
browser_name=(new_browser_name)
click to toggle source
# File lib/cucumber_steps/world_extensions/browser_methods.rb, line 20 def browser_name=(new_browser_name) @browser_name = new_browser_name.to_s.strip end
parse_html_attributes(raw_attributes)
click to toggle source
# File lib/cucumber_steps/world_extensions/browser_methods.rb, line 28 def parse_html_attributes(raw_attributes) raw_attributes.scan(/(\w+)="([^"]+)"/).reduce({}) do |all_matcher, (attr_name, value)| all_matcher[attr_name.downcase.to_sym]=value all_matcher end end
reopen_browser!()
click to toggle source
# File lib/cucumber_steps/world_extensions/browser_methods.rb, line 9 def reopen_browser! if @browser.is_a?(::CucumberSteps::Browser) @browser.close end browser = ::CucumberSteps::Browser.new(browser_name) @browser = browser end