Skip to content

Commit d2b5fee

Browse files
committed
rb - Firefox Nightly specs pass on Linux
1 parent c507f16 commit d2b5fee

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

rb/lib/selenium/webdriver/firefox/binary.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ def nightly_path
155155
"/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin"
156156
when :windows
157157
"#{Platform.find_in_program_files("\\Nightly\\firefox.exe").gsub('m Files (x86)', '~2')}"
158+
when :linux
159+
ENV['FIREFOX_NIGHTLY_PATH'] or raise Error::WebDriverError, "Set ENV['FIREFOX_NIGHTLY_PATH'] when using Firefox Nightly on Linux"
158160
end
159161

160162
unless File.file?(@path.to_s) && version > 43
@@ -170,6 +172,8 @@ def version
170172
`#{path} -v`.strip[/[^\s]*$/][/^\d+/].to_i
171173
when :windows
172174
`\"#{path}\" -v | more`.strip[/[^\s]*$/][/^\d+/].to_i
175+
when :linux
176+
`#{path} -v`.strip[/[^\s]*$/][/^\d+/].to_i
173177
else
174178
0
175179
end

rb/lib/selenium/webdriver/firefox/w3c_bridge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def quit
7272
private
7373

7474
def create_capabilities(opts)
75-
caps = opts.delete(:desired_capabilities) { Remote::W3CCapabilities.edge }
75+
caps = opts.delete(:desired_capabilities) { Remote::W3CCapabilities.firefox }
7676

7777
unless opts.empty?
7878
raise ArgumentError, "unknown option#{'s' if opts.size != 1}: #{opts.inspect}"

rb/lib/selenium/webdriver/remote/w3c_capabilities.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,15 @@ def firefox(opts = {})
6969
}.merge(opts))
7070
end
7171

72-
def w3c?(opts={})
72+
def w3c?(opts = {})
7373
return true if opts[:browser_name] == :firefox_nightly
74+
w3c_opts? || Firefox::Binary.version > 43
75+
end
76+
77+
def w3c_opts?(opts = {})
7478
intersect = Remote::W3CCapabilities::DEFAULTS.keys & opts.keys
7579
common = [:takes_screenshot, :proxy]
76-
!(intersect - common).empty? || Firefox::Binary.version > 43
80+
!(intersect - common).empty?
7781
end
7882

7983
#

rb/spec/integration/selenium/webdriver/window_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ module WebDriver
7777

7878
compliant_on({:browser => :ie},
7979
{:browser => :edge},
80-
{:browser => :firefox, :platform => [:windows, :macosx]},
81-
{:browser => :firefox, :platform => :linux, :window_manager => true}) do
80+
{:browser => :firefox, :platform => [:windows, :macosx]}) do
8281
it "can maximize the current window" do
8382
window.size = old_size = Dimension.new(200, 200)
8483

0 commit comments

Comments
 (0)