| Version 3.4.7 |
| Integration with Build Tools |
Automated GUI testing is just one step in the build process of a software development
project. The basic need for coordinating all those steps of compiling, testing,
documenting and deploying of software has lead to a variety of build tools
(e.g. make, ant, maven) and so called continuous
integration tools (e.g. Jenkins/Hudson, Cruise Control,
Continuum).
In general, by use of QF-Test's command line interface as documented in chapter 16 and chapter 32 a straight forward integration with those tools should be possible.
The following sections contain examples for integrations with a some of the tools mentioned above.
| Ant |
People who are using Apache Ant (http://ant.apache.org) as build system may easily integrate QF-Test in their build file:
|
|
|
|||
|
| Example 20.1: Ant build file build.xml to execute a test-suite | |||
The above example assumes the test-suite to be defined as property when running
ant: ant -Dsuite="c:\Program Files\qfs\qftest\qftest-3.4.7\demo\carconfig\carconfig_en.qft".
| Maven |
People who are using Apache Maven (http://maven.apache.org) as build system may easily
integrate QF-Test in their build. This can be achieved by using the
antrun plugin of Maven. A demo pom.xml file, where QF-Tests
tests are executed in the test phase could look like this:
|
|
|
|||
|
| Example 20.2: Maven build file pom.xml to execute a test-suite | |||
In your project it might become required to run the tests during
another build phase, than the configured test phase in the
example. In this case you have to configure the plugin accordingly, like
described in the Maven documentation.
| Jenkins/Hudson |
Jenkins/Hudson (http://jenkins-ci.org or http://hudson-ci.org) are continuous integration build tools. Therefore they are meant to control and monitor the build process within a software project. One important step in this build process is automated testing.
There are number of benefits to be gained when integrating QF-Test with Jenkins/Hudson:
As Jenkins and Hudson share a common history, following chapters just use Hudson as representative.
| Install and start Hudson |
In general, current information on download and installation of Hudson can be found at http://hudson-ci.org.
Installing Hudson just means to download the war Archive and start it
e.g. via java -jar hudson.war.
Another option without installation is to run Hudson by use of Java Webstart directly via https://hudson.dev.java.net/hudson.jnlp.
As soon as Hudson is started it's web interface can be accessed via http://localhost:8080. It should look like the following:
|
| ![]() |
||
|
| Figure 20.1: Hudson after start-up | ||
| Create a new job for QF-Test |
To create a new job you just need to follow the respective link in Hudson (see above figure) and to select "Build a free-style software project" which leads you to a form containing all the build and report option. All options are documented ("?" buttons right beside each option), so filling the form is very easy.
Please note the following specifics related to QF-Test:
-exitcodeignoreexception now directly
ignores exeptions, errors and warnings for the exit code.
-report.junit <directory> parameter,
allow Hudson to generate a graphical trend chart as well as a short result summary
for a test-run. Note that only results of 'Test-cases' are taken into account for
JUnit reports.
-report.html <directory> parameter, the HTML Publisher plugin in Hudson needs to be
installed. This can be easily achieved via
»Hudson«-»Manage Hudson«-»Manage Plugins«.
After reloading Hudson there should be a respective option available in the
configuration form of your job.
| Install QF-Test Demo Project |
NoteHaving the HTML Publisher Plugin installed, as described above, is recommended before starting with the demo.
When Hudson is successfully installed and run once, there should be a directory
.hudson (note the leading dot) available in you user directory
(e.g. C:/Documents and Settings/Your User Name) in which all Hudson related
files are stored. Among others it contains a folder called jobs holding all
data related to a certain project i.e. configuration files and build results.
To use activate the demo project in Hudson you simply need to extract the Zip archive
QF-Test_Demo_Job.zip from qftest-3.4.7/ext/hudson of
your QF-Test installation into your .hudson/jobs directory. To make the
project now visible in Hudson you might need to restart it or you simply use
»Hudson«-»Manage Hudson«-»Reload Configuration from Disk«.
After choosing the now available QF-Test demo job you should see a page like the following:
|
| ![]() |
||
|
| Figure 20.2: QF-Test Demo Job in Hudson | ||
The test result trend chart as well as the latest test result summary are generated from the QF-Test JUnit reports.
Thanks to the HTML Publisher Plugin also HTML reports are directly available. You may now have a look at the various builds or start a new one yourself via »Build Now«.
The »Configuration« link allows you to inspect and possibly adapt the build options. They might prove useful as basis for your own projects.
NoteThe batch file runtest.bat and the shell script
runtest.sh, located in the qftest_demo directory, contain
handling of the Exit codes for QF-Test to show test-runs with the correct
passed/failed state in Hudson.
3.4.2+The usage of command line argument -exitcodeignoreexception now directly
ignores warnings for the exit code.
For troubleshooting the consol output within the build details is a good point to start.
NoteOn Linux you can replace the "Execute windows batch command" by a "Execute shell" build step with following content:
|
|
|
|||
|
| Example 20.3: Hudson "Execute shell" build step for QF-Test demo job | |||
| Last update: 04/23/2012 Copyright © 1999-2012 Quality First Software GmbH |