You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The standalone spring-test-htmlunit project pulled in selenium-htmlunit-driver as a required dependency, but the spring-test module in Spring Framework 4.2 does not -- since it is an optional dependency in spring-test.
However, the Javadoc and the corresponding section in the Testing chapter do not indicate that selenium-htmlunit-driver is necessary for the Selenium WebDriver support in the Spring MVC Test framework to work.
We will consider adding some additional documentation to the reference guide with regard to optional dependencies in spring-test.
Note that spring-test-htmlunit was a standalone project focusing on HtmlUnit and Selenium integration in the Spring MVC Test framework. As such, it made sense for spring-test-htmlunit to declare required dependencies on the HtmlUnit and Selenium artifacts.
I'd like to point out, however, that the dependency management for selenium-htmlunit-driver in spring-test is no different than for any other dependencies in spring-test.
Since spring-test can be used in many different contexts, Spring cannot enforce dependencies as required. In fact, there is only one required dependency of spring-test, and that is spring-core.
Consider the fact that some developers only use ReflectionTestUtils (which only requires spring-core); whereas, others may use only the support in the TestContext framework (which requires spring-context). And yet there other developers who create transactional tests against embedded databases in conjunction with the Spring MVC Test framework for their MVC controllers. Such scenarios naturally require that the developer include the proper test dependencies on things like spring-tx, spring-webmvc, etc.
Furthermore, if developers wish to test JSON support with Spring MVC Test, they will have to configure dependencies on appropriate libraries such as json-path or jsonassert.
And the same is true for selenium-htmlunit-driver. If you want to use the HtmlUnit or Selenium support, you will naturally have to explicitly configure test dependencies on those libraries.
I wasn't particularly confused; I've been using the snapshot builds since the official announcement, and when tests started failing with messages about driver initialization I figured pretty quickly what the problem was. I agree that a hard dependency on Selenium is probably overkill, but the doc section that describes the new capabilities doesn't give any hint about what's necessary to actually make the code samples work.
Document HtmlUnit & WebDriver deps in reference manual
This commit improves the documentation in the reference manual for the HtmlUnit & Selenium WebDriver integration in the Spring MVC Test framework by mentioning the group and artifact IDs required for this functionality.
Christopher Smith opened SPR-13299 and commented
The standalone
spring-test-htmlunit
project pulled inselenium-htmlunit-driver
as a required dependency, but thespring-test
module in Spring Framework 4.2 does not -- since it is an optional dependency inspring-test
.However, the Javadoc and the corresponding section in the Testing chapter do not indicate that
selenium-htmlunit-driver
is necessary for the SeleniumWebDriver
support in the Spring MVC Test framework to work.Affects: 4.2 GA
Referenced from: commits af905aa
The text was updated successfully, but these errors were encountered: