diff --git a/testing/geckodriver/CHANGES.md b/testing/geckodriver/CHANGES.md index c4f3c41461f9..25121b88ed19 100644 --- a/testing/geckodriver/CHANGES.md +++ b/testing/geckodriver/CHANGES.md @@ -7,6 +7,22 @@ All notable changes to this program is documented in this file. Unreleased ---------- +### Added + +- Added support for searching for Nightly’s default path on macOS + + If the location of the Firefox binary is not given, geckodriver + will from now also look for the location of Firefox Nightly in + the default locations. The ordered list of search paths on macOS + is as follows: + + 1. `/Applications/Firefox.app/Contents/MacOS/firefox-bin` + 2. `$HOME/Applications/Firefox.app/Contents/MacOS/firefox-bin` + 3. `/Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin` + 4. `$HOME/Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin` + + Thanks to [Kriti Singh] for this patch. + ### Removed - Dropped support for legacy Selenium web element references @@ -1194,6 +1210,7 @@ and greater. [Jeremy Lempereur]: https://github.com/o0Ignition0o [Joshua Bruning]: https://github.com/joshbruning [Kalpesh Krishna]: https://github.com/martiansideofthemoon +[Kriti Singh]: https://github.com/kritisingh1 [Mike Pennisi]: https://github.com/jugglinmike [Sven Jost]: https://github/mythsunwind [Vlad Filippov]: https://github.com/vladikoff diff --git a/testing/geckodriver/doc/Capabilities.md b/testing/geckodriver/doc/Capabilities.md index a0c0c89c7dff..2faa7bf31110 100644 --- a/testing/geckodriver/doc/Capabilities.md +++ b/testing/geckodriver/doc/Capabilities.md @@ -33,13 +33,16 @@ started and run. It may contain any of the following fields: to select which custom browser binary to use. If left undefined geckodriver will attempt to deduce the default location of Firefox - on the current system. + on the current system. If Firefox stable is + not installed, it will suggest the default + location of Firefox Nightly instead.

On macOS the path must be absolute to the browser binary, - e.g. /Applications/Firefox.app/Contents/MacOS/firefox. + e.g. /Applications/Firefox.app/Contents/MacOS/firefox or, + in case of Nightly, /Applications/Firefox Nightly.app/Contents/MacOS/firefox Specifying an application bundle such as /Applications/Firefox.app - will not work. + or /Applications/Firefox Nightly.app will not work. diff --git a/testing/mozbase/rust/mozrunner/src/runner.rs b/testing/mozbase/rust/mozrunner/src/runner.rs index ab3ed1da9674..9680c22de36d 100644 --- a/testing/mozbase/rust/mozrunner/src/runner.rs +++ b/testing/mozbase/rust/mozrunner/src/runner.rs @@ -315,8 +315,9 @@ pub mod platform { use std::path::PathBuf; /// Searches the system path for `firefox-bin`, then looks for - /// `Applications/Firefox.app/Contents/MacOS/firefox-bin` under both `/` - /// (system root) and the user home directory. + /// `Applications/Firefox.app/Contents/MacOS/firefox-bin` as well + /// as `Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin` + /// under both `/` (system root) and the user home directory. pub fn firefox_default_path() -> Option { if let Some(path) = find_binary("firefox-bin") { return Some(path); @@ -324,11 +325,10 @@ pub mod platform { let home = dirs::home_dir(); for &(prefix_home, trial_path) in [ - ( - false, - "/Applications/Firefox.app/Contents/MacOS/firefox-bin", - ), + (false, "/Applications/Firefox.app/Contents/MacOS/firefox-bin"), (true, "Applications/Firefox.app/Contents/MacOS/firefox-bin"), + (false, "/Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin"), + (true, "Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin"), ].iter() { let path = match (home.as_ref(), prefix_home) {