From 26feb45686818ae46468df72df91e4b792786fd3 Mon Sep 17 00:00:00 2001 From: Titus Fortner Date: Sun, 6 Mar 2016 13:44:07 -0600 Subject: [PATCH] rb - updates for running ruby specs --- rb/lib/selenium/webdriver/safari/server.rb | 6 +++-- .../webdriver/firefox/marionette_spec.rb | 27 ++++++++++--------- .../spec_support/test_environment.rb | 12 ++++----- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/rb/lib/selenium/webdriver/safari/server.rb b/rb/lib/selenium/webdriver/safari/server.rb index 651f5acd396c9..7b094f34cefa4 100644 --- a/rb/lib/selenium/webdriver/safari/server.rb +++ b/rb/lib/selenium/webdriver/safari/server.rb @@ -101,7 +101,9 @@ def wait_for_connection HEADERS.gsub!("\n", "\r\n") - HTML = "" + def html + "" + end def process_initial_http_request http = @server.accept @@ -121,7 +123,7 @@ def process_initial_http_request else http << HEADERS % [200, 'OK'] http << "\r\n\r\n" - http << HTML + http << html http.close end end diff --git a/rb/spec/integration/selenium/webdriver/firefox/marionette_spec.rb b/rb/spec/integration/selenium/webdriver/firefox/marionette_spec.rb index 2b965638caed7..b3ded4fd058f5 100644 --- a/rb/spec/integration/selenium/webdriver/firefox/marionette_spec.rb +++ b/rb/spec/integration/selenium/webdriver/firefox/marionette_spec.rb @@ -28,22 +28,25 @@ module WebDriver end compliant_on :driver => :marionette do - it "takes a binary path as an argument" do - pending "Set ENV['ALTERNATE_FIREFOX_PATH'] to test this" unless ENV['ALTERNATE_FIREFOX_PATH'] - pending "Set ENV['MARIONETTE_PATH'] to test this" unless ENV['MARIONETTE_PATH'] + # Multiple wires servers gives wrong result here + not_compliant_on :driver => :marionette do + it "takes a binary path as an argument" do + pending "Set ENV['ALTERNATE_FIREFOX_PATH'] to test this" unless ENV['ALTERNATE_FIREFOX_PATH'] + pending "Set ENV['MARIONETTE_PATH'] to test this" unless ENV['MARIONETTE_PATH'] - begin - caps = Remote::Capabilities.firefox(:firefox_binary => ENV['MARIONETTE_PATH']) - driver1 = Selenium::WebDriver.for :firefox, :desired_capabilities => caps, :marionette => true + begin + caps = Remote::Capabilities.firefox(:firefox_binary => ENV['MARIONETTE_PATH']) + driver1 = Selenium::WebDriver.for :firefox, :desired_capabilities => caps, :marionette => true - default_version = driver1.capabilities.version - driver1.quit + default_version = driver1.capabilities.version + driver1.quit - caps = Remote::Capabilities.firefox(:firefox_binary => ENV['ALTERNATE_FIREFOX_PATH']) - driver2 = Selenium::WebDriver.for :firefox, :desired_capabilities => caps, :marionette => true + caps = Remote::Capabilities.firefox(:firefox_binary => ENV['ALTERNATE_FIREFOX_PATH']) + driver2 = Selenium::WebDriver.for :firefox, :desired_capabilities => caps, :marionette => true - expect(driver2.capabilities.version).to_not be == default_version - driver2.quit + expect(driver2.capabilities.version).to_not be == default_version + driver2.quit + end end end end diff --git a/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb b/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb index 31b0a1dbe7a89..aeddd27a2a827 100644 --- a/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb +++ b/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb @@ -200,14 +200,12 @@ def create_remote_driver end def create_firefox_driver - if native_events? - profile = WebDriver::Firefox::Profile.new - profile.native_events = true - - WebDriver::Driver.for :firefox, :profile => profile - else - WebDriver::Driver.for :firefox + binary = ENV['FIREFOX_BINARY'] + if binary + WebDriver::Firefox.path = binary end + + WebDriver::Driver.for :firefox end def create_marionette_driver