Sha256: ae509a31ec2806c5bd39121d0cd961eead64e38701cfb9c5fb1dacbed23b0552

Contents?: true

Size: 706 Bytes

Versions: 1

Compression:

Stored size: 706 Bytes

Contents

require_relative '../client'

module TrueAutomation
  module Driver
    class Capybara < Capybara::Selenium::Driver
      def initialize(app, **options)
        super(app, options)

        @ta_client = TrueAutomation::Client.new

        @options.merge!({browser: :remote,
                        url: 'http://localhost:9515/',
                        desired_capabilities: {
                            browser: :chrome
                        }})
      end

      def browser
        unless @browser
          @ta_client.start

          @ta_client.wait_until_start

          at_exit do
            @ta_client.stop
          end

          super
        end
        @browser
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
true_automation-0.3.4 lib/true_automation/driver/capybara.rb