fix: fix FirefoxManager capabilities merge logic #670
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there!
While working on Firefox log capturing for a project (basically it requires setting
devtools.console.stdout.content
asmoz:firefoxOptions > pref
) I discovered the FirefoxManager behavior regarding options merging looked strange:as soon as one sets the
moz:firefoxOptions
almost all the automation is gone (binary, args, and default prefs are gone).While redefining most of them could be okay, this makes configuration via environment variables inoperant out of the blue, which is not in sync with how ChromeManager works.
This also drops the sensible defaults FirefoxOptions.
This MR tries to address this issue.
It is not easy (or even possible) to introspect the
moz:firefoxOptions
sent to the browser by connecting to it. I didn't find anywhere to hook into the library to check our required capabilities. This is why I took the liberty to introduce a new private method and access it via the reflection in the test suite. This is not the best but I don't see another way atm. Any suggestion is welcome!(PS: I also added some basic tests for the
FirefoxManager
based on theChomeManager
ones)