Skip to content

Commit

Permalink
rb - updates for running ruby specs
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Mar 6, 2016
1 parent 1e5e230 commit 26feb45
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
6 changes: 4 additions & 2 deletions rb/lib/selenium/webdriver/safari/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ def wait_for_connection

HEADERS.gsub!("\n", "\r\n")

HTML = "<!DOCTYPE html><script>#{Safari.resource_path.join('client.js').read}</script>"
def html
"<!DOCTYPE html><script>#{Safari.resource_path.join('client.js').read}</script>"
end

def process_initial_http_request
http = @server.accept
Expand All @@ -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
Expand Down
27 changes: 15 additions & 12 deletions rb/spec/integration/selenium/webdriver/firefox/marionette_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 26feb45

Please sign in to comment.