Skip to main content

An Mkdocs Plugin that Injects Cucumber Results in your Living Documentation

Project description

Mkdocs Gherkin Results Plugin

This plugin parses and injects the results of a Cucumber test report back into your Mkdocs pages.

This allows to create a living documentation where your Cucumber scenarios are written in Gherkin format (see link bellow).

It works by parsing the Cucumber messages, generated during the tests, and injecting the results in the Markdown before it is parsed as HTML, using the on_page_markdown hook.

Features

  • Whenever a test case has passed, a checkmark will be added next to it.

    images/screenshot1.png

  • If a test case has failed a cross will be added.

  • Screenshot attachments

    images/screenshot2.png

Examples

Check the configuration example under tests/test_docs.

It configures both cucumber-js and mkdocs in the same directory.

To run the example, you need to:

  • Run the cucumber tests

    • cd tests/test-docs
    • npm i
    • npm run test
  • Run the mkdocs documentation

    • Create and activate your python venv, using your preferred method

    • Run the documentation generator

      python tests/test-docs/run.py

Installing

In your mkdocs.yaml add the following:

plugins:
- gherkin-plugin:
  show_attachments: True

Dependencies

If you use screenshots attachments, you will need to add the following markdown dependencies as well:

markdown_extensions:
  - admonition
  - pymdownx.details
  - pymdownx.superfences

TODO

  • Fix pending steps not shown
  • Add a short video explaining how it all works

References

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

mkdocs_gherkin_plugin-0.0.6.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

mkdocs_gherkin_plugin-0.0.6-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_gherkin_plugin-0.0.6.tar.gz.

File metadata

  • Download URL: mkdocs_gherkin_plugin-0.0.6.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mkdocs_gherkin_plugin-0.0.6.tar.gz
Algorithm Hash digest
SHA256 65de3800f18423f4489dd2654500de3ff556a12d7050d95393fb095c919a17a9
MD5 dc836a52e10d1a5851e25baf88280f0d
BLAKE2b-256 b64d9fa7e20bdd119ec624ffba36ecde1345ba952eda2864371418308218e6d6

See more details on using hashes here.

File details

Details for the file mkdocs_gherkin_plugin-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_gherkin_plugin-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0da2dccd5605b4e6772038c1b17a1ac75e8721437cdfab7790a1856444957bee
MD5 3b2387e98d850faf1190f7e357adba4d
BLAKE2b-256 bce08ee4a4f62b297add2e356f80c8737a727e797b69bcca0772d42e18395b90

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