This page describes how to integrate SeeTestAutomation and Jenkins by exporting JUnit from SeeTestAutomation.
To perform this integration you must have the following:
- JUnit test which you can execute from within Eclipse
- Server machine on which Jenkins is installed
- Source control environment which allows you to check-in your automation project
Creating an ANT File to Build and Run Your Tests
You can build an ANT file which includes either or both of the following target tasks:
- compile - Compiles your project.
- run_tests - Execute the tests while specifying a junit task
Below is depicted an example ANT file which includes both of these tasks.
For more information about the syntax of the junit task, see http://ant.apache.org/manual/Tasks/junit.html
It is assumed that the specified tests have all the jar files needed for the project stored under the lib directory.
You will find the ‘test’ tag that contains the test class to execute:
If your tests are located in multiple classes you can add multiple lines of <test…
Setting Up Your Jenkins Environment
Step 1: Open your Jenkins environment and create a New Job.
Step 2: Name the project and select Build a free-style software project. Then click OK.
Step 3: Set your project's SVN properties.
Step 4: In the Build section select Add build step, then select Invoke Ant. The first target to designate should be the test build target. (In the above example, this target is named compile).
Step 5: Add an additional Invoke Ant build step, with a target named run_tests.
Step 6: Select Add post-build action > Publish JUnit test report and enter "‘TEST-*.xml" in the Test report XMLs field.
Step 7: Save the project.
Executing the Tests
After you have completed the above setup procedure, execute your tests.
During the run execution graphs will be displayed.