com.atlassian.selenium.junit4
Class CaptureScreenshotListener

java.lang.Object
  extended by org.junit.runner.notification.RunListener
      extended by com.atlassian.selenium.junit4.CaptureScreenshotListener

public class CaptureScreenshotListener
extends org.junit.runner.notification.RunListener

This is a RunListener and captures a screenshot when a test fails. It writes the screenshot into the output directory configured for the maven surefire plugin. The location of this directory is exposed via the system property 'reportsDirectory' by the AMPS IntegrationTestMojo. It will only take a screenshot if the browser is FireFox. Selenium requires for IE a plugin to be able to take screenshots.

Since:
2.0

Constructor Summary
CaptureScreenshotListener()
           
 
Method Summary
protected  String createSreenshotFileName(org.junit.runner.Description description)
           
 void testFailure(org.junit.runner.notification.Failure failure)
           
 
Methods inherited from class org.junit.runner.notification.RunListener
testAssumptionFailure, testFinished, testIgnored, testRunFinished, testRunStarted, testStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CaptureScreenshotListener

public CaptureScreenshotListener()
Method Detail

testFailure

public void testFailure(org.junit.runner.notification.Failure failure)
                 throws Exception
Overrides:
testFailure in class org.junit.runner.notification.RunListener
Throws:
Exception

createSreenshotFileName

protected String createSreenshotFileName(org.junit.runner.Description description)


Copyright © 2014 Atlassian. All rights reserved.