Exam >
On this page

Decorating commands

Allow to replace a boilerplate decorating markup by dedicated code snippets.

Overview

Main purpose of the decorating commands is to simplify specification code by hiding a complex frequently used decoration markup to dedicated commands.

Examples

Given-when-then

To describe an example in the BDD given-when-then style dedicated e:given, e:when, e:then commands may be used.

This commands are purely decorating, have no effect on example logic and may be used in any order.

The following markup:
<e:example name="multistep example">
  <e:given> Given this... </e:given>
  <e:given> and that. </e:given>
  <e:when> Do action 1. </e:when>
  <e:then> Got result 1. </e:then>
  <e:when> Do action 2. </e:when>
  <e:then> Got result 2. </e:then>
</e:example>
will be rendered as:
multistep example

Given


Given this...

Given


and that.

When


Do action 1.

Then


Got result 1.

When


Do action 2.

Then


Got result 2.