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 example directory.

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_results - Boolean value that controls if the test results are shown next to each feature and step. Defaults to True

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs_gherkin_plugin-0.0.12.tar.gz
  • Upload date:
  • Size: 8.1 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.12.tar.gz
Algorithm Hash digest
SHA256 fbf8592c5e4c6c6cfdb04730950a860e025285ea8fafa6e6919b3bf25c43b332
MD5 71c4f5244cf98680522f038126f238fd
BLAKE2b-256 b1c724200d356674e09666e2a3502c0ebb937deb398699b06685bdc380d92e73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_gherkin_plugin-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 e3be651e3d6cad0155b809bccb1c822fecc535a5ef42b9a7aeb5d1db27005f64
MD5 f24ef5e8b75b2f0b35c661e19af234cc
BLAKE2b-256 e8da6afd8f7ba9e45b6c61c7a290501a89a1a45ed0b2333c3701bbfc7f8b5213

See more details on using hashes here.

Supported by

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