Sha256: 79d7d4c7cb4272ab166c333bd1221b91cdc13f0af206b5566946663bfcd0a3b8

Contents?: true

Size: 1.37 KB

Versions: 3

Compression:

Stored size: 1.37 KB

Contents

require File.expand_path("../../spec_helper", __FILE__)

module Selenium
  module WebDriver
    module Opera

      describe Bridge do
        let(:resp)    { {"sessionId" => "foo", "value" => Remote::Capabilities.opera.as_json }}
        let(:service) { double(Service, :start => true, :uri => "http://example.com") }
        let(:http)    { double(Remote::Http::Default, :call => resp).as_null_object   }

        before do
          Service.stub(:default_service => service)
        end

        it 'takes desired capabilities' do
          custom_caps = Remote::Capabilities.new
          custom_caps['foo'] = 'bar'

          http.should_receive(:call).with do |_, _, payload|
            payload[:desiredCapabilities]['foo'].should == 'bar'
            resp
          end

          Bridge.new(:http_client => http, :desired_capabilities => custom_caps)
        end

        it 'lets direct arguments take presedence over capabilities' do
          custom_caps = Remote::Capabilities.new
          custom_caps['opera.arguments'] = '--foo 1'

          http.should_receive(:call).with do |_, _, payload|
            payload[:desiredCapabilities]['opera.arguments'].should == '--foo 2'
            resp
          end

          Bridge.new(:http_client => http, :desired_capabilities => custom_caps, :arguments => %w[--foo 2])
        end
      end

    end # Opera
  end # WebDriver
end # Selenium

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
browserstack-webdriver-2.40.1 spec/unit/selenium/webdriver/opera/bridge_spec.rb
browserstack-webdriver-0.0.22 spec/unit/selenium/webdriver/opera/bridge_spec.rb
browserstack-webdriver-0.0.1 spec/unit/selenium/webdriver/opera/bridge_spec.rb