class SeleniumConnect::Runner::PhantomJS

PhantomJS browser runner

Attributes

config[R]

Public Class Methods

new(config) click to toggle source
# File lib/selenium_connect/runners/phantomjs.rb, line 10
def initialize(config)
  @config = config
end

Public Instance Methods

launch() click to toggle source
# File lib/selenium_connect/runners/phantomjs.rb, line 18
def launch
  init_browser
end
match?() click to toggle source
# File lib/selenium_connect/runners/phantomjs.rb, line 14
def match?
  config.browser == 'phantomjs'
end

Private Instance Methods

config_browser() click to toggle source
# File lib/selenium_connect/runners/phantomjs.rb, line 29
def config_browser
  executable_path = get_executable_path
  browser = Selenium::WebDriver::Remote::Capabilities.phantomjs
  browser['phantomjs.binary.path'] = executable_path
  browser
end
get_executable_path() click to toggle source
# File lib/selenium_connect/runners/phantomjs.rb, line 24
def get_executable_path
  current_dir_path = File.join(File.dirname(File.expand_path(__FILE__)))
  current_dir_path + '/../../../bin/phantomjs'
end
init_browser() click to toggle source
# File lib/selenium_connect/runners/phantomjs.rb, line 36
def init_browser
  config_browser
end