pytest plugin to display BDD info in HTML test report
Project description
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.
Usage
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.
Command line options
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 if PATH does not exist or is not specified. See CSS classes for how the column cells are structured.
CSS classes
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").
Structure of cell for BDD test
.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
Structure of cell for non-BDD test with functional comment
.col-description .col-description-func-doc
Structure of cell for non-BDD test without functional comment
.col-description .col-description-no-doc /* an empty div */
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest-bdd-html-0.1.11a0.tar.gz
.
File metadata
- Download URL: pytest-bdd-html-0.1.11a0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5855af9b549e61009cc97e428649f3f75960e1e42d2d3085f71b4d3fecdadfdc |
|
MD5 | 7e9a35e18c753827150143ccac19afa9 |
|
BLAKE2b-256 | b26251573e14102411d95edc06ef48b10ec850dcadb74295e4b3e5fe796bbd87 |
File details
Details for the file pytest_bdd_html-0.1.11a0-py3-none-any.whl
.
File metadata
- Download URL: pytest_bdd_html-0.1.11a0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b005f4883ba1b43f999a5d59db80eff63776f5736f4a2a79e5391367512d1d75 |
|
MD5 | 3f8e0777b61f35ecf0f9804cb23441c1 |
|
BLAKE2b-256 | 04b35405db491b18c1cab401f824fdf1a29354150aa3fe5ceffe437c46dcbb93 |