Sha256: bbe6aff762d76c0257689f8f7f16896441dfd54cecc7f372e32bed579356bd3e

Contents?: true

Size: 851 Bytes

Versions: 5

Compression:

Stored size: 851 Bytes

Contents

# Encoding: utf-8

class 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
        browser
      end

      def init_browser
        config_browser
      end

    end # Chrome
  end # Runner
end # SeleniumConnect

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
selenium-connect-3.7.1 lib/selenium_connect/runners/phantomjs.rb
selenium-connect-3.7.0 lib/selenium_connect/runners/phantomjs.rb
selenium-connect-3.6.0 lib/selenium_connect/runners/phantomjs.rb
selenium-connect-3.5.0 lib/selenium_connect/runners/phantomjs.rb
selenium-connect-3.4.0 lib/selenium_connect/runners/phantomjs.rb