-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ChromeOptions and FirefoxOptions instead of DesiredCapabilities #995
Use ChromeOptions and FirefoxOptions instead of DesiredCapabilities #995
Conversation
… chrome-diver dependencies for ChromeOptions and FirefoxOptions
…dCapabilities method
…ns. Added @before that checks if correct browser is started. Tiny test refactoring
modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java
Outdated
Show resolved
Hide resolved
…rowserWebDriverContainer.java Co-Authored-By: pavelpp <[email protected]>
…to selenium-update-capabilities # Conflicts: # modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java
…ncies to testCompile only, as they are only needed for tests
I'd just like to clarify whether this is a 'breaking change' for our users or not. I fear that it could be. Because our Selenium dependency is |
@rnorth Good point, I will test this locally in a dummy project when I find some more time |
Updated fallback to Chrome when selenium version is 2.x. Now if detected Selenium version is 2.x, we will use DesiredCapabilities.chrome() and with newer Selenium versions - ChromeOptions() as a fallback with unspecified capabilities. That was the only issue I found. Verified locally with a dummy project and Selenium 2.53.1 dependency - works like a charm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR LGTM.
Just for clarification, using DesiredCapabilities
is deprecated?
Will the class get removed in the future?
We probably also have to update the docs.
modules/selenium/src/main/java/org/testcontainers/containers/SeleniumUtils.java
Show resolved
Hide resolved
Thanks for addressing my query @pavelpp - LGTM |
Thanks for your contribution @pavelpp, merged! |
The latest and recommended way to request a RemoteWebDriver is by passing ChromeOptions / FirefoxOptions to the constructor instead of DesiredCapabilities. Both of these implement Capabilities interface so the change was quite straightforward, deprecating the old method and changing the field type to Capabilities.
Another improvement is that we will not throw IllegalException when capabilities are not provided, but fall back to starting a chrome container. So now you could just write:
omitting
withCapabilities(new ChromeOptions())
and it will work out of the box.