class Object

Public Instance Methods

init_driver() click to toggle source
# File lib/diffux_ci/runner.rb, line 24
def init_driver
  tries = 0
  begin
    driver = Selenium::WebDriver.for DiffuxCI::Utils.config['driver'].to_sym
  rescue Selenium::WebDriver::Error::WebDriverError => e
    # "unable to obtain stable firefox connection in 60 seconds"
    #
    # This seems to happen sporadically for some versions of Firefox, so we want
    # to retry a couple of times it in case it will work the second time around.
    tries += 1
    retry if tries <= 3
    raise e
  end

  driver.manage.timeouts.script_timeout = 3 # move to config?

  driver
end
resolve_viewports(example) click to toggle source
# File lib/diffux_ci/runner.rb, line 13
def resolve_viewports(example)
  configured_viewports = DiffuxCI::Utils.config['viewports']

  viewports =
    example['options']['viewports'] || [configured_viewports.first.first]

  viewports.map do |viewport|
    configured_viewports[viewport].merge('name' => viewport)
  end
end