Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. 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 these will be overwritten in this automatic build process.
  2. In Eclipse, open the SeleniumCubicTest project. Run "Edit SeleniumCubicTest/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
  3. In Eclipse, go to the "Servers" view and start up Tomcat (sometimes, if you want to use Debug mode, you may have to turn off Eclipse's automatic refreshes, because that may get Eclipse Tomcat into perpetual restarts).
  4. Open "SeleniumCubicTest/tomcatFromScratch/TestFromScratch.aat". Right click, "Run As..." -> "Run CubicTest with Selenium". If you want to test the Survey Manager survey creation (which mostly needs testing by hand), you can alternatively run TestSurveyManagerFromScratch.aat -- which includes the same initialization as TestFromScratch.aatbuild.properties
    1. Read the directions in there about how to customize this file.
  5. 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).
    1. In Eclipse, go to "File -> Export ..."
    2. Under "Plug-In Development" choose "Deployable plug-ins and fragments". Click "Next".
    3. Check the box next to "WST_Eclipse_Helper_Plugin".
    4. Click the radio button "Install into host"
    5. Click "Finish"
    6. When Eclipse asks if you want to restart, say "Yes".
  6. 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.
  7. 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.

Whenever you add a feature, you should add it to the Selenium Automatic Test.

Note
title"The type javax.faces.context.ExternalContext cannot be resolved"

If you get an error saying "The type javax.faces.context.ExternalContext cannot be resolved", try this:

  1. Right click on your project, WST_Manager_Webapp.
  2. In the left side, expand "Project facets" and select"Java Server Faces".
  3. On the top of the right panel, do you see an error message saying something like "Required class java.faces.FactoryFinder does not exist in selected libraries"?
  4. Click the little disk icon with an arrow (representing download).
    1. Select IceFaces core Library v1.8.2.
    2. Click Next.
    3. Check "I accept".
    4. Click "Finish".
    5. In the list of libraries, make sure the box next to it is checked -- check it if it's not.
  5. Repeat the same for the "IceFaces Facelets Library", "IceFaces Support Library", "JSF 1.2 (Sun RI)", and "Standardized EL Library"
  6. Sometimes Eclipse doesn't actually add these correctly. You may need to click "Ok" then go back in and check off each of those libraries in the list.
Note
title"java.lang.ClassNotFoundException: org.eclipse.birt.report.listener.ViewerServletContextListener"

If you see this, read about it and how to fix it.

Note
title"java.lang.IllegalArgumentException: Document base (Your-Eclipse-Workspace)\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\WST_Manager_Webappdoes not exist or is not a readable directory"

Follow the same steps to solve as above – close your project, quit eclipse, open your project, clean it, and try again.

Note
title"java.lang.OutOfMemoryError: PermGen space"

If you see this in Tomcat, you should follow these directions .

Next Step -> Step 4 - Learn About The Architecture