Skip to content
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

Document selenium-htmlunit-driver dependency [SPR-13299] #17889

Closed
spring-projects-issues opened this issue Jul 31, 2015 · 3 comments
Closed
Assignees
Labels
in: test Issues in the test module type: documentation A documentation task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Christopher Smith opened SPR-13299 and commented

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.


Affects: 4.2 GA

Referenced from: commits af905aa

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

Christopher Smith, thanks for raising this issue.

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 hope this clarifies things for you.

Regards,

Sam

@spring-projects-issues
Copy link
Collaborator Author

Christopher Smith commented

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.

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

Completed in GitHub commit af905aa:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

2 participants