org.assertj.swing.junit.ant.package.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-swing-junit Show documentation
Show all versions of assertj-swing-junit Show documentation
Assertj-Swing JUnit4 extension
The newest version!
Support for embedding
screenshots of failed GUI tests in a JUnit HTML report (created with
Ant.)
To embed screenshots of failed GUI tests in the HTML JUnit reports, please follow the these steps:
-
Mark GUI tests with the annotation
org.assertj.swing.annotation.GUITest
-
Add a definition of the Ant task
assertjreport
(provided by this module)
-
Use the formatter
{@link org.assertj.swing.junit.ant.ScreenshotOnFailureResultFormatter}
inside the
junit
Ant task
-
Use the Ant task
assertjreport
instead of junitreport
, and specify in its classpath where the
fest-swing-junit jar is
Here is an example:
<target name="test" depends="compile">
<taskdef resource="assertjjunittasks" classpathref="lib.classpath" />
<junit forkmode="perBatch" printsummary="yes" haltonfailure="no" haltonerror="no">
<classpath refid="lib.classpath" />
<classpath location="${target.test.classes.dir}" />
<classpath location="${target.classes.dir}" />
<formatter classname="org.assertj.swing.junit.ant.ScreenshotOnFailureResultFormatter" extension=".xml" />
<batchtest fork="yes" todir="${target.junit.results.dir}">
<fileset dir="${target.test.classes.dir}" includes="**/*Test*.class" />
</batchtest>
</junit>
<assertjreport todir="${target.junit.report.dir}">
<classpath refid="lib.classpath" />
<fileset dir="${target.junit.results.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${target.junit.report.dir}/html" />
</assertjreport>
</target>