Sha256: 29c656a7bd5ccedaed6c55b351215628617a2bbcd9af30ad28e33bc8dfa3ac60

Contents?: true

Size: 859 Bytes

Versions: 4

Compression:

Stored size: 859 Bytes

Contents

# Encoding: utf-8

module SeleniumConnect
  # Runner
  class Runner
    # PhantomJS browser runner
    class PhantomJS
      attr_reader :config

      def initialize(config)
        @config = config
      end

      def match?
        config.browser == 'phantomjs'
      end

      def launch
        init_browser
      end

      private

      def get_executable_path
        current_dir_path = File.join(File.dirname(File.expand_path(__FILE__)))
        current_dir_path + '/../../../bin/phantomjs'
      end

      def config_browser
        executable_path = get_executable_path
        browser = Selenium::WebDriver::Remote::Capabilities.phantomjs
        browser['phantomjs.binary.path'] = executable_path
        return browser
      end

      def init_browser
        config_browser
      end

    end # Chrome
  end # Runner
end # SeleniumConnect

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
selenium-connect-2.3.0 lib/selenium-connect/runners/phantomjs.rb
selenium-connect-2.2.0 lib/selenium-connect/runners/phantomjs.rb
selenium-connect-2.1.1 lib/selenium-connect/runners/phantomjs.rb
selenium-connect-2.1.0 lib/selenium-connect/runners/phantomjs.rb