Skip to main content

behave-runner

A unified CLI entry point for the Behave BDD ecosystem.

CI Coverage PyPI Python Docs License

behave-runner is a single, extensible command-line interface for the Behave BDD ecosystem. It wraps common Behave workflows into focused subcommands and degrades gracefully when optional plugins are not installed.

Why behave-runner?

  • One CLI for everything — run, list, filter, lint, format, watch, report, trace, generate and analyze scenarios from one tool.
  • Plugin-friendly — optional extras add parallel execution, retries, priority ordering, trace viewers, report formatters, step libraries and more without breaking core behavior.
  • Fast feedback — watch mode, impact analysis and rich terminal output keep the test loop tight.
  • Project scaffolding — initialize a new Behave project, generate steps or features, and validate project health with doctor.

Features

  • Run, list, select, lint, format, watch, report, trace, steps, impact, generate, init, config, open and record commands.
  • Optional parallel execution, sharding, retries and priority ordering.
  • Configuration profiles via pyproject.toml or behave.ini.
  • Watch mode that re-runs tests when files change.
  • Reports in console, HTML, Markdown, JSON, sheets and file formats.
  • Trace viewer and web dashboard support.
  • Step library management and feature/step generation.
  • Impact analysis to detect scenarios affected by code changes.
  • Graceful degradation when optional extras are missing.

Requirements

  • Python 3.11 or higher
  • Behave ecosystem packages (installed automatically as optional extras)

Installation

pip install behave-runner

To install all optional extensions:

pip install "behave-runner[all]"

For development:

git clone https://github.com/MathiasPaulenko/behave-runner.git
cd behave-runner
pip install -e ".[dev]"
pre-commit install

Getting Started

1. Initialize a project

behave-runner init

This creates a standard Behave layout: features/, features/steps/ and environment.py.

2. List scenarios

behave-runner list

Shows every scenario in the project without running anything.

3. Run the suite

behave-runner run

Runs every feature. You can also target a specific feature or tag:

behave-runner run --tags @smoke
behave-runner run features/login.feature

4. Filter with select

behave-runner select --tags @smoke
behave-runner select --pattern "login"

5. Watch files

behave-runner watch

Re-runs behave-runner run whenever a .feature, .py or config file changes. Press Ctrl+C to stop.

6. Lint and format

behave-runner lint
behave-runner format

7. Reports and traces

behave-runner report generate --format html
behave-runner report show

With behave-trace installed:

behave-runner trace show

Configuration

You can store profiles in pyproject.toml:

[tool.behave-runner]
profiles.default.tags = ["~@wip"]
profiles.smoke.tags = ["@smoke"]

Or use a classic behave.ini file. Run behave-runner config show to inspect configuration.

Commands

Command Description
run Execute Behave tests.
watch Re-run tests when files change.
list List scenarios without executing them.
select Filter scenarios by tags, regex or name.
lint Lint .feature files.
format Format .feature files.
doctor Check project health.
init Initialize a new Behave project.
generate Generate steps or features.
record Record a browser session and generate steps.
report Generate and open reports.
trace View traces or serve a trace dashboard.
steps Manage step libraries.
impact Detect scenarios affected by code changes.
open Open the latest report or trace in the default browser.
config Manage configuration profiles.

Ecosystem

behave-runner is the entry point for the BehaveLib ecosystem. The libraries below can be installed individually or through behave-runner extras.

Library Category Purpose Extra
behave Core BDD framework. core
behave-kit Core Timeouts and config profiles. core
behave-model Core Feature and scenario parsing. core
behave-pool Execution Parallel and sharded runs. parallel
behave-priority Execution Priority ordering and smoke flags. priority
behave-retry Execution Retry and flaky report support. retry
behave-trace Debug Trace viewer and UI. trace
behave-doctor Quality Project health and impact analysis. doctor
behave-lint Quality Feature file linting. lint
behave-format Quality Feature file formatting. format
behave-gen Scaffold Project and feature generation. gen
behave-steplib Steps Step library management. steplib
behave-comments Utility Comment metadata extraction. comments
behave-tables Utility Table helpers.
wavexis Recording Browser session recording. record
behave-modern-console-report Reporting Console report. report-console
behave-modern-html-report Reporting HTML report. report-html
behave-modern-md-report Reporting Markdown report. report-md
behave-modern-json-report Reporting JSON report. report-json
behave-modern-sheets-report Reporting XLSX/CSV report. report-sheets
behave-modern-file-report Reporting File report. report-file

Install groups:

# Execution extras
pip install "behave-runner[parallel,priority,retry]"

# Reporting extras
pip install "behave-runner[report-html,report-json]"

# Everything
pip install "behave-runner[all]"

Documentation

Full documentation is available at:

https://mathiaspaulenko.github.io/behave-runner/

Contributing

Contributions are welcome. Please read CONTRIBUTING.md for guidelines.

Links

Acknowledgements

behave-runner is built on top of the Behave BDD framework and the BehaveLib ecosystem of plugins. It uses Typer for the CLI and Rich for terminal output.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

behave_runner-1.1.0.tar.gz (70.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

behave_runner-1.1.0-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file behave_runner-1.1.0.tar.gz.

File metadata

  • Download URL: behave_runner-1.1.0.tar.gz
  • Upload date:
  • Size: 70.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for behave_runner-1.1.0.tar.gz
Algorithm Hash digest
SHA256 90798c8c6f54adfb3f8192ea4993d9aa58b23f1abea802b8badf3dacefc5c54e
MD5 397d9faa025dc403b51b3eca27b10a4b
BLAKE2b-256 9ed67d7e74e0d9e63f98206019982984841a17179d7e54458d3aad593dce2e38

See more details on using hashes here.

Provenance

The following attestation bundles were made for behave_runner-1.1.0.tar.gz:

Publisher: release.yml on MathiasPaulenko/behave-runner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file behave_runner-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: behave_runner-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for behave_runner-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f71ee6db5afbf356b9d35399285346b8b618d356a9690b688990a15c7d6c5d8
MD5 74a9a6856180dc73f4444254c6736d77
BLAKE2b-256 28ec3288f55e626b096e31900a6ec6f361a54e302ab833629fcccb7970be9da6

See more details on using hashes here.

Provenance

The following attestation bundles were made for behave_runner-1.1.0-py3-none-any.whl:

Publisher: release.yml on MathiasPaulenko/behave-runner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page