Skip to content

Commit 0931594

Browse files
committed
rb - add browser option for Firefox Nightly
1 parent 00f4f2e commit 0931594

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

rb/lib/selenium/webdriver/common/driver.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ def for(browser, opts = {})
5252
else
5353
Firefox::Bridge.new(opts)
5454
end
55+
when :firefox_nightly
56+
Firefox::Binary.nightly_path
57+
Firefox::W3CBridge.new(opts)
5558
when :remote
5659
Remote::Bridge.new(opts)
5760
when :ie, :internet_explorer

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,16 @@ def version
153153
`#{path} -v`.strip[/[^\s]*$/][/^\d+/].to_i
154154
end
155155

156+
def nightly_path
157+
@path = case Platform.os
158+
when :macosx
159+
nightly_path = "/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin"
160+
nightly_path if File.exist?(nightly_path)
161+
when :windows
162+
Platform.find_in_program_files("\\Nightly\\firefox.exe")
163+
end
164+
end
165+
156166
private
157167

158168
def windows_path

0 commit comments

Comments
 (0)