##GWT & GXT Driver Sample This project is a sample of how to set up GWT-Driver and GXT-Driver for use in a maven build. Take a look at each commit to see what is added as an example of how you can build tests before code, or go back and write more tests.
This is not a best practice of writing Selenium/WebDriver code, nor is it a best practice of integration tests in general. Instead, it is only a demonstration of how to use GWT-Driver, plus a relatively straightforward way of building Maven out to run these tests.
##Reference
##Features
###Things this does:
- Build a HelloWorld style app, and some simple tests demonstrating how to poke it and be sure it behaves.
###Things this does not do:
- Show how to make a good GWT app. As long as you are using Widgets in your app, you can use gwt-driver to find them.
- Demonstrate good project setup. This does an okay job of breaking tests out from the project, and building almost the same way
- Demonstrate how to run tests in multiple browsers. There are many right ways to do this - this does none of them, but only works with a local Firefox instance.
##Running
To run the project and see the app for yourself, use mvn jetty:run
.
To build a war file, use mvn install
.
To build a war file if and only if integration tests pass, use mvn -Pintegration-test
.
##Walk through Walk through this build one commit at a time - the important parts are these:
- Initial project, with a simple pom, gwt module, and entrypoint
- First pass at test - added g*t-driver dependencies, profile to run them (and exclude from
test:test
), a sample util to make static find calls easier, and two simple test methods that both fail - Actual (dummy) wiring in the login button, and a
Thread.sleep
(should be aWait
!) in the test to make the login test pass - Finished wiring and added one more test - this is the first point where
mvn -Pintegration-test
actually finishes successfully.