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.7.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

mkdocs_gherkin_plugin-0.0.7-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs_gherkin_plugin-0.0.7.tar.gz
  • Upload date:
  • Size: 6.7 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.7.tar.gz
Algorithm Hash digest
SHA256 a83659124e97de498079c9d93ca57265113460dab606f2e8b375e75fe362e339
MD5 0800d3520753719039002a8010eae7d7
BLAKE2b-256 1468fea4eec59d573d629617dd7b4b7785e53c16f57ab65a4f8825372a5966b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_gherkin_plugin-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e17feb29c91f244313d6c90b2be2b979969fb7da27cf87f14d04de3937236149
MD5 fefca016f17d42ec2c1ab83dd4f5b121
BLAKE2b-256 8c9e89b164a87c71b1c90c1cf3d25c1c8b16ba1a3533e5dd300f41cd8755a072

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