Skip to main content

pytest plugin to display BDD info in HTML test report

Project description

PyPI release GitHub release Issues License

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


Download files

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

Source Distribution

pytest-bdd-html-0.1.12a0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

pytest_bdd_html-0.1.12a0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pytest-bdd-html-0.1.12a0.tar.gz.

File metadata

  • Download URL: pytest-bdd-html-0.1.12a0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for pytest-bdd-html-0.1.12a0.tar.gz
Algorithm Hash digest
SHA256 77a2cae591a60d6116ba1d022316c330a1392820b092e2c625a46d4d5c592ffd
MD5 7c3726ae85534abb30b73fae8fc74c76
BLAKE2b-256 603835124850f8d32136a827795a23e487d2041c34d615a921ea453aab24901a

See more details on using hashes here.

File details

Details for the file pytest_bdd_html-0.1.12a0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_bdd_html-0.1.12a0-py3-none-any.whl
Algorithm Hash digest
SHA256 4fabf69d2bd826a34ef4a2acf3db1a3b42b0ef5e38358003fc5355f06e09c986
MD5 2e7b07ca024b759711ee5240e6efc9e9
BLAKE2b-256 3c1225bf8d82a54d3b61da97d493b071316c699ca8f30d4d538a9e46d03a8445

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page