public class ScreenshotExtension
extends java.lang.Object
implements org.concordion.api.extension.ConcordionExtension
It can also be used as a command, to explicitly include screenshots in the output.
By default, the screenshot will be of the full visible screen. This can be overridden using a custom ScreenshotTaker
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMAND_NAME |
static java.lang.String |
EXTENSION_NAMESPACE |
Constructor and Description |
---|
ScreenshotExtension() |
Modifier and Type | Method and Description |
---|---|
void |
addTo(org.concordion.api.extension.ConcordionExtender concordionExtender) |
ScreenshotExtension |
setMaxWidth(int maxWidth)
Sets the maximum width that will be used for display of the images in the output.
|
ScreenshotExtension |
setScreenshotOnAssertionFailure(boolean takeShot)
Sets whether screenshots will be embedded in the output when assertions fail.
|
ScreenshotExtension |
setScreenshotOnAssertionSuccess(boolean takeShot)
Sets whether screenshots will be embedded in the output when assertions pass.
|
ScreenshotExtension |
setScreenshotOnThrowable(boolean takeShot)
Sets whether screenshots will be embedded in the output when uncaught Throwables occur in the test.
|
ScreenshotExtension |
setScreenshotTaker(ScreenshotTaker screenshotTaker)
Set a custom screenshot taker.
|
public static final java.lang.String COMMAND_NAME
public static final java.lang.String EXTENSION_NAMESPACE
public void addTo(org.concordion.api.extension.ConcordionExtender concordionExtender)
addTo
in interface org.concordion.api.extension.ConcordionExtension
public ScreenshotExtension setScreenshotTaker(ScreenshotTaker screenshotTaker)
Robot
which will take a shot of the full visible screen.screenshotTaker
- public ScreenshotExtension setMaxWidth(int maxWidth)
public ScreenshotExtension setScreenshotOnAssertionFailure(boolean takeShot)
true
.takeShot
- true
to take screenshots on assertion failures, false
to not take screenshots.public ScreenshotExtension setScreenshotOnAssertionSuccess(boolean takeShot)
false
.takeShot
- true
to take screenshots on assertion success, false
to not take screenshots.public ScreenshotExtension setScreenshotOnThrowable(boolean takeShot)
true
.takeShot
- true
to take screenshots on uncaught Throwables, false
to not take screenshots.