Seeking guidance around integration testing in multi-module project

Hi all…

I’m in the process of converting an old and complex Ant build to Gradle, and while most of the process is going well, I’m looking for advice on how best to handle our integration testing (Selenium-based).

A brief discussion of the project structure - the application is semi-modular but (currently) packaged into a single monolithic war file… very old-school. As such, we have some “service” projects containing the business/persistence layer for different functional areas, “ui” projects containing screen implementations, and a “war” project that bundles all the jars from the other projects and provides all the static content, etc.

So, in the current model, the Selenium tests are in the UI projects… the Ant build compiles and packages everything, starts a Tomcat server into which it deploys the War file, then goes back to the UI projects to run the Ant tasks responsible for running the Selenium tests. And I’m assuming for now that under Gradle, things will work the same way.

This is where I’m currently stuck on the conversion. In theory, the “integration testing” material in the docs should be good for building the tests… I’ve not done it yet, but what I read makes sense. However, I’m uncertain about the running part, and in particular how to arrange for the “war” project to be packaged and deployed into a container before running those tests.

And also more broadly, am I thinking about this in the right way? I’m not completely new to Gradle, but I’ve previously used it only in relatively simple projects… this project is something of a learning experience.