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

Automatic selenium version matching #97

Merged
merged 3 commits into from Mar 30, 2016

Conversation

Projects
None yet
2 participants
@rnorth
Copy link
Member

rnorth commented Mar 27, 2016

Prior to this the version of docker-selenium drivers used was fixed at 2.45.0. This could be somewhat risky if users had a different, newer, version of selenium-api in their projects.

This change makes the library detect the classpath version of selenium-api, and use that to select an appropriate docker-selenium container version.

rnorth added some commits Mar 26, 2016

Add automatic selection of selenium docker images based on available …
…version of the selenium API JAR.

Refactor into a separate utility class.
*/
public class SeleniumUtils {

public static final String DEFAULT_SELENIUM_VERSION = "2.45.0";

This comment has been minimized.

@sskorol

sskorol Mar 28, 2016

shouldn't it be 2.52.0 now?

This comment has been minimized.

@rnorth

rnorth Mar 28, 2016

Member

Yes, in that 2.52.0 is the latest available version :D. However, a major feature of Testcontainers' selenium support is that versions of browsers are stable and users should not be afflicted by sudden breakage when a browser version silently changes in the background.

The automatic detection of classpath selenium version should make this a moot point, as finally there's only one single source of the truth for the version the user wants to use.

If for some reason this automated detection fails, though, I wouldn't want to trip up a user who had been happily using v2.45.0, so unfortunately the default needs to be the lowest common denominator rather than the latest version.

The best case is the user gets exactly the version of the container images they need (matching their API JAR). The worst case is they get the older version they would have had to deal with anyway, hopefully :)

/**
* Utility methods for Selenium.
*/
public class SeleniumUtils {

This comment has been minimized.

@sskorol

sskorol Mar 28, 2016

this class could be also made final according to best practices for utility classes

This comment has been minimized.

@rnorth

rnorth Mar 28, 2016

Member

Yep, good point - will do.

@rnorth rnorth merged commit e19c4f2 into master Mar 30, 2016

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@rnorth rnorth deleted the automatic-selenium-version-matching branch Mar 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment