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

Configuration

  • show_attachments - Boolean value that controls if the file attachements are shown in the final result. Defaults to True

  • messages_path - Location where to load the cucumber messages ndjson. Defaults to "gherkin_messages.ndjson"

Example:

plugins:
  show_attachments: True
  messages_path: "gherkin_messages.ndjson"

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

Uploaded Source

Built Distribution

mkdocs_gherkin_plugin-0.0.8-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs_gherkin_plugin-0.0.8.tar.gz
  • Upload date:
  • Size: 6.8 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.8.tar.gz
Algorithm Hash digest
SHA256 c94b587b6728ac50f5d04055b3a6a050787de4768c2cbbaef8ebb2c45a25afbe
MD5 cc748b5c544c3a21ba642a4aaaed3d54
BLAKE2b-256 94fe6fad5d78a782dd4d589637b0be34113755b4edf6ecc41d1883c236fab06b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_gherkin_plugin-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 302fbd80bad8b27972a7e3504ba6777e361141fb66fd07d8240bae635403dd8d
MD5 a113c8d7b20caabfa8241b1d2cc292c4
BLAKE2b-256 b449f797c0c0ed609d3045c20ac7b65a1a3660e6a247c9b5b401daddbe6afa20

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