Sha256: 687619746859ccdc1399654b98b6c79827eed1a59b737d4dfbbfae9bebc5aea6
Contents?: true
Size: 1.85 KB
Versions: 1
Compression:
Stored size: 1.85 KB
Contents
require_relative '../client' module Capybara module Queries class SelectorQuery alias_method :original_description, :description def description(only_applied = false) desc = original_description matched_result = desc.match(/.*__taonly__(.+)__taonly__.*/) if selector = matched_result && matched_result[1] desc = "TrueAutomation element #{selector} on the page" end desc end end end end module TrueAutomation class RecordNotFound < StandardError; end module Driver class Capybara < Capybara::Selenium::Driver def initialize(app, **options) @port = options.delete(:port) || 9515 @driver = options.delete(:driver) @driver_version = options.delete(:driver_version) super(app, options) @ta_client = TrueAutomation::Client.new @remote = '' options ||= {} ta_url = options[:ta_url] || "http://localhost:#{@port}/" capabilities = options[:desired_capabilities] || {} if options and options[:browser] == :remote raise 'Remote driver URL is not specified' unless options[:url] capabilities[:taRemoteUrl] = options[:url] @remote = ' --remote' else capabilities[:browser] = options[:browser] || :chrome end @options.merge!(browser: :remote, url: ta_url, desired_capabilities: capabilities) end def browser unless @browser @ta_client.start(port: @port, remote: @remote, driver: @driver, driver_version: @driver_version) @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.22 | lib/true_automation/driver/capybara.rb |