public class StoryboardExtension
extends java.lang.Object
implements org.concordion.api.extension.ConcordionExtension
Further information can be found in the Specification.
Modifier and Type | Class and Description |
---|---|
static class |
StoryboardExtension.AppendTo |
Constructor and Description |
---|
StoryboardExtension() |
Modifier and Type | Method and Description |
---|---|
StoryboardExtension |
addCard(Card card)
Add custom cards to the storyboard
|
StoryboardExtension |
addCard(ScreenshotCard card)
Add screenshot card to the storyboard
|
void |
addCardImage(java.lang.String sourcePath,
java.lang.String filename)
Add custom card image that will be shared by all tests, must be called before test starts otherwise this will do nothing
|
StoryboardExtension |
addContainer(Container container)
Allow custom containers to be added the storyboard.
|
StoryboardExtension |
addNotification(java.lang.String title,
java.lang.String description,
CardImage image,
CardResult result) |
StoryboardExtension |
addNotification(java.lang.String title,
java.lang.String description,
java.lang.String data,
CardImage image,
CardResult result)
Adds data/information card to story board
|
StoryboardExtension |
addNotification(java.lang.String title,
java.lang.String description,
java.lang.String data,
java.lang.String fileExtension,
CardImage image,
CardResult result)
Adds data/information card to story board
|
StoryboardExtension |
addScreenshot(java.lang.String title,
java.lang.String description)
Adds screenshot card to story board
|
StoryboardExtension |
addSectionContainer(java.lang.String title)
Adds a section container to the storyboard.
|
void |
addTo(org.concordion.api.extension.ConcordionExtender concordionExtender) |
StoryboardExtension |
closeContainer()
Mark current container as completed, any cards added past this point will go to the parent container/storyboard.
|
CustomCardImage |
getCardImage(java.lang.String filename)
Get a previously added custom card image
|
java.lang.String |
getCurrentExampleTitle()
Get the title of the current example
|
boolean |
hasScreenshotTaker()
Check to see if a screenshot taker has been set
|
StoryboardExtension |
insertContainer(Container container)
Allow custom containers to be added the storyboard.
|
StoryboardExtension |
insertSectionContainer(java.lang.String title)
Adds a section container to the storyboard.
|
StoryboardExtension |
markPriorScreenshotsForRemoval()
Marks any screenshot cards added before this point to be deleted if tests completes successfully.
|
StoryboardExtension |
removeScreenshotTaker()
Removes the screenshot taker so no further screenshots will be taken.
|
StoryboardExtension |
setAcceptCards(boolean accept)
Prevent cards and containers from being added to the the storyboard.
|
StoryboardExtension |
setAcceptsScreenshots(boolean accept)
Deprecated.
Has been replaced by
setAcceptCards(boolean) and will be removed in the next version. |
StoryboardExtension |
setAppendMode(StoryboardExtension.AppendTo appendMode)
Set how items are added to the storyboard
Append to end of Storyboard (original behaviour)
If item is added within currently executing Example Command append to example element, otherwise append to Storyboard (default)
If item is added within currently executing Example Command append to new section container in Storyboard, otherwise append to Storyboard
|
StoryboardExtension |
setScreenshotTaker(org.concordion.ext.ScreenshotTaker screenshotTaker)
Set a screenshot taker.
|
StoryboardExtension |
setSupressRepeatingFailures(boolean value)
To limit the number of items added to the storyboard, the default behaviour is to ignore second or subsequent failure.
|
StoryboardExtension |
setTakeScreenshotOnExampleCompletion(boolean value)
A screenshot of the current page will be automatically added to the storyboard (as long as
the screenshot taker has been set) when:
an example completes
a container is closed (either automatically or by calling closeContainer())
|
StoryboardExtension |
setTitle(java.lang.String title)
Set the title to display on the Storyboard and/or ExampleContainer
|
StoryboardExtension |
skipFinalScreenshot()
If configured to take final screenshot for example (see
setTakeScreenshotOnExampleCompletion(boolean) ), this
will override that behaviour until:
an example completes
a container is closed (either automatically or by calling closeContainer())
|
public void addTo(org.concordion.api.extension.ConcordionExtender concordionExtender)
addTo
in interface org.concordion.api.extension.ConcordionExtension
public void addCardImage(java.lang.String sourcePath, java.lang.String filename)
sourcePath
- Location of imagefilename
- Filename of imagepublic CustomCardImage getCardImage(java.lang.String filename)
filename
- Original filename of imagepublic StoryboardExtension setTitle(java.lang.String title)
This is a token effort at multi-language support.
title
- The titlepublic StoryboardExtension setAppendMode(StoryboardExtension.AppendTo appendMode)
appendMode
- The card append modepublic StoryboardExtension setSupressRepeatingFailures(boolean value)
value
- true
to not add card on second, or subsequent, failure (default behaviour), false
to add a card for every failure.public boolean hasScreenshotTaker()
public StoryboardExtension setScreenshotTaker(org.concordion.ext.ScreenshotTaker screenshotTaker)
RobotScreenshotTaker
which will take a shot of the full visible screenscreenshotTaker
- Takes screenshots of the system under testpublic StoryboardExtension removeScreenshotTaker()
public StoryboardExtension setTakeScreenshotOnExampleCompletion(boolean value)
If not using the example command then final screenshots must be added manually.
This setting is also obeyed by containers that are configured to auto close such as the section container.
value
- true
to take screenshot (default), false
to not take screenshotpublic StoryboardExtension skipFinalScreenshot()
setTakeScreenshotOnExampleCompletion(boolean)
), this
will override that behaviour until:
This also prevents screenshots being taken if a test fails or an exception is thrown.
@Deprecated public StoryboardExtension setAcceptsScreenshots(boolean accept)
setAcceptCards(boolean)
and will be removed in the next version.accept
- Accept screenshot settingpublic StoryboardExtension setAcceptCards(boolean accept)
Setting this to false will disable prevent cards and containers being added until either it is set to true, or the current example or specification completes.
accept
- True to allow cards to be added, false to prevent them from being addedpublic StoryboardExtension addScreenshot(java.lang.String title, java.lang.String description)
title
- Card titledescription
- Card descriptionpublic StoryboardExtension markPriorScreenshotsForRemoval()
public StoryboardExtension addNotification(java.lang.String title, java.lang.String description, CardImage image, CardResult result)
title
- short descriptiondescription
- card summaryimage
- StockCardImage or custom CardImage to displayresult
- Success/failure statuspublic StoryboardExtension addNotification(java.lang.String title, java.lang.String description, java.lang.String data, CardImage image, CardResult result)
title
- short descriptiondescription
- card summarydata
- any data that may want to present to user when they click on it, can be empty, xml, json, etcimage
- StockCardImage or custom CardImage to displayresult
- Success/failure statuspublic StoryboardExtension addNotification(java.lang.String title, java.lang.String description, java.lang.String data, java.lang.String fileExtension, CardImage image, CardResult result)
title
- short descriptiondescription
- card summarydata
- any data that may want to present to user when they click on it, can be empty, xml, json, etcfileExtension
- file extension of file to write data to, defaults to txtimage
- StockCardImage or custom CardImage to displayresult
- Success/failure statuspublic StoryboardExtension addSectionContainer(java.lang.String title)
See also insertSectionContainer(String)
.
title
- Title of the section breakpublic StoryboardExtension insertSectionContainer(java.lang.String title)
See also addSectionContainer(String)
.
title
- Title of the section breakpublic StoryboardExtension closeContainer()
Unlike containers that are auto closed automatically (such as the section container when auto close is on) a final screenshot will NOT be taken.
public StoryboardExtension addCard(Card card)
card
- Custom cardpublic StoryboardExtension addCard(ScreenshotCard card)
card
- Custom cardpublic StoryboardExtension addContainer(Container container)
See also insertContainer(Container)
.
container
- Custom containerpublic StoryboardExtension insertContainer(Container container)
See also addContainer(Container)
.
container
- Custom containerpublic java.lang.String getCurrentExampleTitle()