Skip to main content

Create living documentation from BDD specs

Project description

Using a Python BDD test runner like behave, create living documentation from your BDD feature files. This library will create documents that contain up-to-date information about your BDD specs and helps generate a static site for your living documentation.

Current supported document types:

  • *.mmark files (to be used by Hugo)

Installation

pip install livingdocs

You should also install the Hugo binaries in order to generate your static site: https://gohugo.io/overview/installing/

Quick Start

Use the CLI command livingdocs to configure your Hugo site:

$ livingdocs
  Your site's title: <enter title>
  Your site's description: <enter description>
  ....

This will create a livingdocs folder in your root directory which will have a Hugo skeleton to create a static site.

Using a test runner like behave, you can generate documents for each feature, scenario and step. In environment.py, you can use the DocsMaker to capture this information:

from livingdocs.maker import DocsMaker

def before_all(context):
    context.docs = DocsMaker('feature')

def before_scenario(context, scenario):
    context.docs.start_scenario(context, scenario)

def after_scenario(context, scenario):
    context.docs.end_scenario(context, scenario)

def before_feature(context, feature):
    context.docs.start_feature(context, feature)

def after_feature(context, feature):
    context.docs.end_feature(context, feature)

def before_step(context, step):
    context.docs.start_step(context, step)

def after_step(context, step):
    """
    if context.browser is an instance
    of Selenium Webdriver, then it will
    take a snapshot of this step.
    """
    context.docs.end_step(context, step)

Development

First create a virtual env, then to run the tests use:

tox -e py27

License

  • BSD License

Changelog

0.2.0 (2016-09-16)

  • Feature - added cli command to generate static site

0.1.3 (2016-09-13)

  • Bugfix - Feature filename path can be nested directories

0.1.2 (2016-08-21)

  • Don’t include Pillow (or PIL) in basic install setup.

0.1.1 (2016-08-21)

  • Requirements are installed during setup.

0.1.0 (2016-08-21)

  • First release on PyPI.

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

livingdocs-0.2.0.tar.gz (233.2 kB view details)

Uploaded Source

Built Distribution

livingdocs-0.2.0-py2.py3-none-any.whl (228.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file livingdocs-0.2.0.tar.gz.

File metadata

  • Download URL: livingdocs-0.2.0.tar.gz
  • Upload date:
  • Size: 233.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for livingdocs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 54410503b44c514ae2c9dd84143aa54726f679dae9405972acafca99d93ba104
MD5 b3fe6806b7cde21716312f828b37ddbf
BLAKE2b-256 cc35df7137f9fbe76df53d85ab2f007d167d7ea3005b1cc4fd824b6e12074c84

See more details on using hashes here.

File details

Details for the file livingdocs-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for livingdocs-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7772c6dde2eea6e5c925c82f046e710c8085f34d839119947843b290d103333c
MD5 4406b0036757842063cfd9ea25da86be
BLAKE2b-256 2c2b637c5cbeae30addaa76feedded97e1c6f8a761ddf65b78bd9740149c3804

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