It's been a busy week, with JavaZone and some exiting things going on in my project at the same time.
I'll get straight to the point and post an exampe app that will solve the problems from the previous post.
I started off with a maven archetype create webapp.
I added configuration of the Jetty plugin (note that this isn't really necessary to get the rest working, but is handy for testing out the webapp with mvn jetty:run).
I put the web-test running in its own profile, so it won't be ran with each mvn install. This is to underline the fact that you probably don't want the web-tests to be run each time you build the app. Web tests take too much time and should be done by your CI system.
So, all the details of configuring maven for running Selenese tests are inside the
- Firefox 2.0 or later installed
- Maven 2.0.7 (or thereabouts) installed
- M2_REPO (environment variable) pointed to a folder without spaces *
<settings> <localRepository>c:\m2-repo</localRepository> .... </settings>
This will most likely not be necessary on a non-windows system.
- Commando-line into \maven-selenium-example
- Type mvn install -Pweb-test
- Wait a while for all the dependencies to download
- Build successful!
Be aware that since there are plenty of snapshot dependencies in this configuration, any of them could be upgraded any day and (if the developers have done a poor job) break the web-test configuration. If you want a 100% stable integration test environment you should specify version number on each plugin (especially cargo-maven2-plugin, and change the selenium-maven-plugin to non-snapshot).