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.
-
If a test case has failed a cross will be added.
-
Screenshot attachments
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_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mkdocs_gherkin_plugin-0.0.9.tar.gz
.
File metadata
- Download URL: mkdocs_gherkin_plugin-0.0.9.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2050b6019f30e13253c13507e42f249c063df8881009d2c043033dc4129cc872 |
|
MD5 | 8f8a06a41eb473e237b265621d5b4126 |
|
BLAKE2b-256 | 4c2eb2a711b1a5b77b465cdbd174d5b6b6327f4871de849fb603e43e12051f6c |
File details
Details for the file mkdocs_gherkin_plugin-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: mkdocs_gherkin_plugin-0.0.9-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c896a90ea3fc93083f5aaf9c08bd4fbfbc2c0ea30236b42ad1f94b5cd452473 |
|
MD5 | 9bbc985671de4f6397d2c0096e9bd8f7 |
|
BLAKE2b-256 | 46b4ab3e7106c4a5a1a2f6ab40beabf35fec449677ddca2a8327dfb73353c42e |