Examples
June 29, 2026 ยท View on GitHub
The repository includes two example projects under examples/.
Demo generator
examples/demo_generator/ contains a standalone script that builds a synthetic
execution and renders it as HTML. It is useful for design iteration, screenshots,
and quick demos without a real Behave suite.
python examples/demo_generator/generate_demo.py
Output: examples/demo_generator/demo-report.html.
Functional Behave project
examples/behave_project/ is a complete Behave project with features, steps,
environment.py hooks, and behave.ini configured to use the modern formatter.
Install dependencies:
cd examples/behave_project
pip install -r requirements.txt
Run the suite:
behave
It generates report.html in the same directory. The project exercises:
- Backgrounds and scenario outlines.
- Gherkin
Rulegroups (requires Behave 1.3.x). - Passing, failing, skipped, pending, and undefined scenarios.
- Attachments on failure.
- Slow scenarios with duration timing.
- Custom
bmr.title,bmr.company,bmr.theme,bmr.default_view,bmr.show_copy_commandandbmr.show_environment_varsuserdata.
Run a subset of features:
behave --tags=login
behave --tags=checkout
behave --tags=smoke