私は現在、後で Hudson テスト サーバーで実行される Fest Junit テスト ケースを作成しています。テストケースが失敗した場合は、デスクトップのスクリーンショットを撮ってもらいたいです。これを設定する方法に関するチュートリアルがあるこの URL を見つけました: http://fest.codehaus.org/Taking+Screenshots+of+JUnit+Test+Failuresしかし、テストはローカルで実行されません。
これは、私が実行しようとしているJavaコードのコピーです。
@RunWith(GUITestRunner.class)
public class AddingNewUserTest extends FestTest {
@Before
public void setup(){
super.setup(constants.users.name);
}
@After
public void cleanup(){super.shutDown();
}
@GUITest
public void testAddingNewUser() throws InterruptedException{
//java code
}
そして、実行しようとしている JUnit Ant タスク:
<target name="run.tests" description="Runs all the junit tests.">
<echo message="Run the tests"/>
<taskdef resource="festjunittasks" classpathref="classpath" />
<junit printsummary="true" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="yes">
<classpath refid="classpath" />
<formatter classname="org.fest.swing.junit.ant.ScreenshotOnFailureResultFormatter" extension=".xml" />
<batchtest todir="${test.output.reports.test.dir}" unless="testcase" fork="true">
<fileset dir="${output.mainclasses.dir}" includes="**/AddingNewUserTest.class" excludes="**/FestTest.class,**/DefaultsTest.class"/>
</batchtest>
</junit>
<festreport todir="${test.output.reports.dir}">
<classpath refid="classpath" />
<fileset dir="${test.output.reports.test.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${test.output.reports.dir}/html" />
</festreport>
<antcall target="kill.server"/>
</target>
どんな助けでも素晴らしいでしょう。

レポートで Junit によってスローされたエラーのスクリーン ショット