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
  • Core dependencies (behave, behave-kit, behave-model) are installed automatically

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 --name my-project

This creates a standard Behave layout: features/, features/steps/ and environment.py inside the named project directory.

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]
parallel = 4

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

[tool.behave-runner.profiles.ci]
parallel = 8
format = "json"

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. included
behave-kit Core Timeouts and config profiles. included
behave-model Core Feature and scenario parsing. included
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 Scaffolding 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.3.0.tar.gz (95.9 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.3.0-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: behave_runner-1.3.0.tar.gz
  • Upload date:
  • Size: 95.9 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.3.0.tar.gz
Algorithm Hash digest
SHA256 f836e878aeade76a37205f56811ddf6325059f324e29322b43796f9feed03a6a
MD5 31718c6c66ed2c22d90bd484093c4488
BLAKE2b-256 8190bd96486797c6d45b0b773f2f08e1bf6711165c4ada93c06d290c7b3950a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for behave_runner-1.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: behave_runner-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 37.8 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d600ce5c2421233735f5233724e2a3ecbe5d3f70ae36efc1b64a17edbe6f0a90
MD5 0faa8c6f830d5b03d03370b533f373ef
BLAKE2b-256 d55e7170be8d9ba4ed08b6178c5c8a351587352e0c656edf0301472bf0d689a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for behave_runner-1.3.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