Continuum web app tests depends on continuum-webapp module of Continuum. It depends on a successful build result in continuum-trunk.
The module makes use of the latest Selenium Remote Control release (1.0.1)
The module makes use of the following maven plugins:
Continuum web app tests module uses TestNG for the following reasons:
View the module's pom.xml here
Installation instructions for Windows and Unix-based systems can be found here
Checkout continuum trunk here.
svn co https://svn.apache.org/repos/asf/continuum/trunk continuum-trunk or svn co http://svn.apache.org/repos/asf/continuum/trunk continuum-trunk
Getting started with the tests:
After getting the source from the repository, execute the following:
cd /path/to/continuum-trunk/ mvn clean install
| continuum-trunk must have a successful build or else there's no way to run continuum-webapp-test successfully. |
cd /path/to/continuum-trunk/continuum-webapp-test/
Default configuration (i.e. App's Base URL, Selenium Host, Selenium Port's values, etc.) are stored in a property file that can be found in /path/to/continuum-trunk/continuum-webapp-test/src/test/resources/testng.properties (or here). You may change the values in it before executing the next command.
mvn clean install
This command will:
Continuum web app tests is invoked with a testng.xml file. The contents of that xml file is displayed below and/or this could be found in /path/to/continuum-trunk/continuum-webapp-test/src/test/testng/config/ directory.
<suite name="ContinuumTest" verbose="1"> <test name="BasicTest" enabled="true"> <groups> <run> <include name="about" /> </run> </groups> <packages> <package name="org.apache.continuum.web.test" /> </packages> </test> <test name="AdminTest" enabled="true"> <groups> <run> <include name="login" /> <include name="mavenTwoProject"/> <include name="projectGroup" /> <include name="mavenOneProject" /> <include name="antProject" /> <include name="shellProject" /> <include name="buildDefinition" /> <include name="notifier" /> <include name="schedule" /> <include name="myAccount" /> <include name="queue" /> <include name="purge" /> <include name="repository" /> <include name="configuration" /> <include name="installation" /> <include name="buildEnvironment" /> <include name="buildDefinitionTemplate" /> <include name="userroles"/> <include name="agent"/> </run> </groups> <packages> <package name="org.apache.continuum.web.test" /> </packages> </test> </suite>
The order of the build when running the tests are defined in the annotations of each test. Groups are divided into unit tests. If want to run a specific test, you may edit the testng.xml file and exclude the undesired tests to be run.
Example: <test name="AdminTest" enabled="true"> <groups> <run> <include name="login" /> <exclude name="mavenTwoProject"/> <exclude name="projectGroup" /> <exclude name="mavenOneProject" /> <include name="antProject" /> <exclude name="shellProject" /> ... ... ... </run> </groups> <packages> <package name="org.apache.continuum.web.test" /> </packages> </test>
More information about testng.xml here.
Modify src/test/resources/testng.properties as needed then execute:
mvn clean install -Dbrowser=iexplore (or -Dbrowser=safari or -Dbrowser=other -DbrowserPath=/path/to/browser)
Modify src/test/resources/testng.properties as needed, then execute:
mvn clean install -Dexisting-container
(This skips the Cargo plugin configuration that starts a container with the Continuum webapp deployed)
continuum-webapp-test also has Selenium IDE scripts. Here's how you should run it:
After running the continuum webapp tests, cd to /path/to/continuum-trunk/continuum-webapp-test/target/surefire-reports/ and open the index.html file.
Click the 'ContinuumTest' suite link
Click the 'Results' link to view the summary of the tests. (Passed/Failed/Skipped)
If there are test failures, cd to /path/to/continuum-trunk/continuum-webapp-test/target/screenshots/ to view the captured image files.
Screen shots are saved with the format "methodName(className.java_lineNumber)-time.png" in order to easily debug the error encountered.
Test scripts available here automate the various features of Continuum. Listed below are the existing scripts with which you can help improve the testing process or you may contribute on any areas you see not covered.
Continuum Feature/s for development:
If you would like to be involved, start by reading the Continuum documentation to familiarize yourself with the features of the application.
This section will guide you on how to contribute new script/s to run with the existing ones.
You can find out what features already have tests by looking at the source code of the scripts on the Test Coverage section. If you look at the scripts, you can see which features have lots of tests and which need more..but note that even if the coverage looks good there may be more interesting tests to write..
Once you have written a good test scenario, the script must be placed in this directory:
/path/to/continuum-trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/
Put your abstract classes in this directory:
/path/to/continuum-trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/
Once you have a successful build in continuum-webapp-test, you are now ready to create a patch and submit the work you have done to the community. Just follow the guidelines on the Creating Patches and Submitting Patches section.
The listed items on continuum-webapp-test Test Coverage are not yet complete. Releasing Projects is one of the feature listed for development but basically, the existing scripts still has missing scenarios that needs to be completed, such as:
As listed above, those are just examples on how to improve Continuum's existing tests. As you go along with the scripts, you may encounter scenarios that needs to be modified so that it will be easily read to fellow developers. Tests contributions are welcome in this community. See Adding New Tests section on how.
After adding new tests or improving existing tests, the next step is to create a patch.
Below are the steps needed for creating patches:
svn up
mvn clean install
mvn clean install
Directory: svn add /path/to/the/new_module/
File: svn add /path/to/the/new_module/file.extension
Note: If the modifications are made to existing files which are already under version control, there is no need to do "svn add".
cd /path/to/continuum-trunk/
svn diff > PatchName.patch
After creating the patch, the next step is to contribute by sending the patch to the community!
New Tests for X Feature or Improve Tests for an Existing Feature
Windows/Linux/Mac Maven version Java version
Describe what the patch is for. (changes made to the existing version) Post the results of the build (test runs, failures, errors etc)
| If nothing happens in a few days, write to the dev list and nudge the developers to review your patch. |