A pytest
plugin to display BDD info in the pytest-html-generated HTML test report.
Apart from pytest-html
, it plugs into pytest-bdd plugin's hooks.
To use the plugin, just install it:
# source .venv/bin/activate
pip install pytest-bdd-html
pytest -vv ...
If you use tox, list the plugin as a dependency:
; tox.ini
[testenv]
deps = ...
pytest-bdd-html
commands = pytest -vv ...
There will be a new 3rd column with label "Description" in the test report specified by --html=...
command line option of pytest-html
.
Available command line options are as follows.
--bdd-html-css=PATH
- Specifies a path to a custom CSS file for styling of the Description column.
pytest_bdd_html/resources/style.css
is used by default ifPATH
does not exist or is not specified. See CSS classes for how the column cells are structured.
For each test case (one row in the pytest-html
-generated HTML report), the Description column's cell has one of the following structures, differing for BDD and non-BDD tests (.XXX
denotes a HTML element with CSS class="XXX"
).
.col-description .col-description-bdd-doc /* Feature */ div h3 .text div /* feature name */ div /* feature description; optional */ /* Scenario */ div h3 .text /* Steps */ div h3 .steps .step /* one or more steps */ .step-name .step-message
.col-description .col-description-func-doc
.col-description .col-description-no-doc /* an empty div */
bumpver test -p 0.1.13a0 "MAJOR.MINOR.PATCH[PYTAGNUM]" bumpver update -n -d -p bumpver update -n -p