Metadata-Version: 2.5
Name: tracera-behave
Version: 2.0.1
Summary: Tracera Autotest adapter for Behave
Project-URL: Homepage, https://tracera.dev/docs/behave
Project-URL: Changelog, https://github.com/tracera-dev/tracera-releases/releases?q=Adapters+%28Python%29
Project-URL: Bug-Tracker, https://github.com/tracera-dev/tracera-releases/issues
Author-email: Tracera <contact@tracera.dev>
License-Expression: Apache-2.0
License-File: LICENSE.md
Keywords: autotest,bdd,behave,test-reporting,testops,tracera
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.11
Requires-Dist: tracera-core==2.0.1
Description-Content-Type: text/markdown

# tracera-behave

Tracera Autotest adapter for Behave.

**Tested on Python 3.11–3.15 and Behave 1.2.6–1.3.3.**

```bash
pip install tracera-behave
```

How-to: [Behave](https://tracera.dev/docs/behave). Shared env / run mode: [Autotest adapters](https://tracera.dev/docs/adapters#environment).

## Setup

In `features/environment.py`:

```python
from tracera_behave.environment import (
    after_all,
    after_feature,
    after_scenario,
    after_step,
    before_all,
    before_scenario,
    before_step,
)
```

That import is enough — Behave loads the hooks from `environment.py`. Run: `behave features`.

## Bind

Scenario tags `@tracera.id:…` and optional URL-encoded `@tracera.name:…`. If `@tracera.name` is omitted → Scenario name. Imperative `tracera.test_case` from step code is also available.

## Skip

Stock `context.scenario.skip(reason)`. The reason becomes a result `comment`.

## Steps

Gherkin steps → **Test**. Nest with `tracera.step(title, body)`, `@tracera.step("…")`, or `with` / `async with tracera.step("…"):`. `before_scenario` / `after_scenario` → **Setup** / **Teardown**; `before_all` / `before_feature` are not reported.

## Comments, errors, and attachments

`tracera.comment` / `tracera.error` / `tracera.attachment` — see [Autotest adapters](https://tracera.dev/docs/adapters#comments-errors-and-attachments). Inside a Gherkin step they land on that step; outside any step (for example in `before_scenario` / `after_scenario`) they land on the result.

## Parameterized

Scenario Outline — put `@tracera.id:` on the Outline or Scenario. If `@tracera.name` is omitted → each test uses the Scenario name after `<…>` is filled from its Examples row. Tags do not support `{param}` templates.

**Multi-process Behave:** set a worker label (`BEHAVE_WORKER`, …) on each process so they share one run.
