<- Previous Step: Step 2 - Getting The Code
...
If you've installed all of the optional tools described on Step 1 - How To Set Up Your Development Environment then you can automate your build and test process.
...
- Make sure that you DON'T have anything important in your MySQL database named "wsttemptest" nor "wsttemptestsurvey". These MySQL databases will be wiped clean every time you launch the test framework. Also make sure that you DON'T have a launch profile in Eclipse that's named "websurveytoolbox" nor "wsttemptestsurvey" because this these will be used as the default webapp name.
- In Eclipse, open the SeleniumCubicTest project. Run "tomcatFromScratch/antTomcatFromScratch.xml" as an ant build -- follow the prompt and build the .war file as it specifies. Wait until the build completes (you may have to check the console). If it fails you may have to edit the build.properties in tomcatFromScratch
- In Eclipse, go to the "Servers" view and start up Tomcat (sometimes this works better in Run mode, not Debug mode, because sometimes Debug mode will get into perpetual restarts which can get in the way).
- Open "SeleniumCubicTest/tomcatFromScratch/TestFRomScratch.aat". Right click, "Run As..." -> "Run CubicTest with Selenium"overwritten in this automatic build process.
- Edit SeleniumCubicTest/tomcatFromScratch/build.properties
- Read the directions in there about how to customize this file.
- Let's install a quick shortcut to building, deploying, and testing, your code.
(Note that every time you checkout and there's been an update to the "WST_EclipseHelper_Plugin" project you'll want to do this again).- In Eclipse, go to "File -> Export ..."
- Under "Plug-In Development" choose "Deployable plug-ins and fragments". Click "Next".
- Check the box next to "WST_Eclipse_Helper_Plugin".
- Click the radio button "Install into host"
- Click "Finish"
- When Eclipse asks if you want to restart, say "Yes".
- In Eclipse, go to the "WST" menu and click "Build And Run Tests" every time you want to test out your code. It'll build, run the full test suite, and report on errors.
- Watch the test fly by!
You may want to add your own tests for new features you develop -- you may want to put these in your own test file or add them to TestFromScratch.aat.
Now that you've run the test build, learn about Adding to the Selenium Automatic Test .
.
Whenever you add a feature, you should add it to the Selenium Automatic Test.
Note | ||
---|---|---|
| ||
If you get an error saying "The type javax.faces.context.ExternalContext cannot be resolved", try this:
|
Note | ||
---|---|---|
| ||
If you see this, read about it and how to fix it. |
Note | ||
---|---|---|
| ||
Follow the same steps to solve as above – close your project, quit eclipse, open your project, clean it, and try again. |
Note | ||
---|---|---|
| ||
If you see this in Tomcat, you should follow these directions . |
...