Sometimes your test might perform a large number of steps and the storyboard becomes unwieldy. Adding cards to a collapsible sections will allow you to group the steps your test has taken into different sections on the storyboard.
Behaviour:
addSectionContainer() or addContainer(new SectionContainer(title))
methodssetAutoClose(false)
on the container, this will embed subsequently added containers into this containercloseContainer()
insertSectionContainer()
or insertContainer(new SectionContainer(title))
methodssetAppendMode(AppendTo.NEW_STORYBOARD_SECTION_PER_EXAMPLE)
method on the extension<span concordion:execute="addSectionContainer(#TEXT)">Example 1</span> <span concordion:assertTrue="addCard(#TEXT)">Card 1</span>
When this snippet is run with this fixture, this results in a new section being added to the Example.
<div class="testinput" concordion:example="example1"> <h3>Example 1</h3> <span concordion:assertTrue="addCard(#TEXT)">Card 1</span> <span concordion:assertTrue="addCard(#TEXT)">Card 2</span> </div> <div class="testinput" concordion:example="example2"> <span concordion:assertTrue="addCard(#TEXT)">Card 3</span> </div>
When this snippet is run with this fixture and the append mode is set to AppendTo.NEW_STORYBOARD_SECTION_PER_EXAMPLE, this results 2 sections being added to the Storyboard.
<span concordion:execute="addSectionContainer(#TEXT)">Example 1</span> <span concordion:assertTrue="addCard(#TEXT)">Card 1</span> <span concordion:execute="closeContainer()">Example 1</span> <span concordion:assertTrue="addCard(#TEXT)">Card 1</span>
When this snippet is run with this fixture, this results in 1 card being added to the storyboard after the last section.
<span concordion:execute="addSectionContainer(#TEXT)">Example 1</span> <span concordion:assertTrue="addCard(#TEXT)">Card 1</span> <span concordion:execute="addSectionContainer(#TEXT)">Example 1</span> <span concordion:assertTrue="addCard(#TEXT)">Card 1</span>
When this snippet is run with this fixture, this results in 2 sections being added to the storyboard.
<span concordion:execute="addSectionContainerToContainer(#TEXT)">Example 1</span> <span concordion:assertTrue="addCard(#TEXT)">Card 1</span> <span concordion:execute="addSectionContainerToContainer(#TEXT)">Embedded Example</span> <span concordion:assertTrue="addCard(#TEXT)">Card 1</span>
When this snippet is run with this fixture, this results in 1 section being added to the storyboard.
<span concordion:execute="addSectionContainer(#TEXT)">Example 1</span> <span concordion:assertTrue="addFailureCard(#TEXT)">Card 1</span>
When this snippet is run with this fixture, this results the section title getting a failure status and left expanded.
Example 1: Add Section Container
Click image to see example
Example 2: Automatically Add Section Container For Each Example
Click image to see example
Example 3: Manually Close Container
Click image to see example
Example 4: Automatically Close Container
Click image to see example
Example 5: Add Container To Container
Click image to see example
Example 6: Add Failure Card to Section
Click image to see example