JBoss Community

Screencasting of running tests

modified by Vlado Pakan in JBoss Tools Development - View the full document

Recording screencast of running tests is implemented in JBT test suite via class [ScreenRecorderExt.java|https://svn.jboss.org/repos/jbosstools/trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/test/util/ScreenRecorderExt.java].

 

To save screencast of test just insert this code to proper place within test class:

 

{code}

screenRecorderExt = new ScreenRecorderExt();

// start scren cast recording

screenRecorderExt.start(videoFileLocation);

<... test instructions ...>

// stop screen cast recording

screenRecorderExt.stop();

{code}

 

Implementation for SWTBot tests

For SWTBot tests is screencasting fully implemented. Once enabled via setting system property swt.bot.test.record.screencast=true all tests from test run are saved together with requirements processing.

For each test class of test run one video file is saved with name of the test class. Recorded files are saved in the screencasts directory at the same location where SWTBot tests are creating screenshots directory.

Implementing class is RequirementAwareSuite.java

Important methods:

{code}

private static void startScreenRecorder(String className)

private static void stopScreenRecorder()

protected Statement withBeforeClasses(Statement statement)

public void run(RunNotifier notifier)

{code}

Comment by going to Community

Create a new document in JBoss Tools Development at Community