public class ScreenShotOnFailure
extends org.junit.rules.TestWatcher
Constructor and Description |
---|
ScreenShotOnFailure(ScreenShotFilenameGenerator generator)
Construct a rule that captures screen shots and uses
generator to generate the file names for the
screen shot files. |
ScreenShotOnFailure(String screenshotDirectory)
Construct a rule that captures screen shots and uses
DefaultScreenShotFilenameGenerator to generate the
file names for the screen shot files. |
Modifier and Type | Method and Description |
---|---|
protected void |
failed(Throwable exception,
org.junit.runner.Description description)
Handle a test case failure by taking a screen shot from the browser and writing it to a file.
|
public ScreenShotOnFailure(String screenshotDirectory)
DefaultScreenShotFilenameGenerator
to generate the
file names for the screen shot files.screenshotDirectory
- The directory root where the screen shot files will be generated.public ScreenShotOnFailure(ScreenShotFilenameGenerator generator)
generator
to generate the file names for the
screen shot files.generator
- Generates unique file names for the screen shot files.protected void failed(Throwable exception, org.junit.runner.Description description)
failed
in class org.junit.rules.TestWatcher
exception
- The exception that describes the test case failure.description
- Describes the unit test that failed.Copyright © 2011-2013 Brian Thomas Matthews. All Rights Reserved.