3.14. Step - 09 : Sphinx

We can also get a very beautiful output of the existing steps documentation using behave:

behave --no-color --format sphinx.steps --dry-run --no-summary -o out

The generated documentation would look as follows

3.14.1. Generated Steps

3.15. steps_addition

Module:

steps_addition

Filename:

features/steps/steps_addition.py

3.15.1. Step Overview

Step Definition

Given

When

Then

Step

Given I have ‘{num1:d}’ and ‘{num2:d}’

x

When I add them

x

Then The result must be ‘{value:d}’

x

3.15.2. Step Definitions

3.15.2.1. Step: Given I have ‘{num1:d}’ and ‘{num2:d}’

We store num1 and num2 from context.math

Inputs:
  • num1 : Any number

  • num2 : Any number

3.15.2.2. Step: When I add them

We add num1 and num2 of context.math

3.15.2.3. Step: Then The result must be ‘{value:d}’

We ensure expected value matches value returned by context.math