Making it easy for developers to run tests in Feedback Loop - Selenium

Making it easy for developers to run tests in Feedback Loop - Selenium


Ideally, we want our tests to run every time somebody pushes code to the central code repository; part of doing this is ensuring that it's very easy to run our tests. If somebody can just check out our code base and run one command and have all of the tests just work, it means they are far more likely to run them.


Making it easy for developers to run tests in Feedback Loop - Selenium
Making it easy for developers to run tests in Feedback Loop


We are going to make this easy by using Apache Maven. To steal a quote from the Maven documentation: "Maven is an attempt to apply patterns to a project's build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices."

A maven is a tool that can be used to build and manage Java projects (including
downloading any dependencies that you require) and is used in many companies
as part of the standard enterprise infrastructure. Maven is not the only solution to this problem (for example, Gradle is a very powerful alternative that is on par
with Maven in many areas and exceeds it in a few), but it is one that you are
most likely to see on the ground and one that most Java developers will have
used at some point in their careers.



One of the major plus points is that it encourages developers to use a standardized project structure that makes it easy for people who know Maven to
navigate around the source code; it also makes it very easy to plug into a CI
system (such as Jenkins or TeamCity), as all the major ones understand Maven
POM files.

How does this make it easy for developers to run tests? Well, when we have set
our project up using Maven, they should be able to check out our test code and
simply type "mvn clean verify" into a Terminal window. This will automatically
download all dependencies, set up the classpath, and run all of the tests.


It doesn't really get much easier than that.





Building our test project with Apache Maven - selenium

Building our test project with Apache Maven - Selenium If you are running the Debian derivative of Linux, it is as easy as using this...