Skip to main content

A sphinx extension for behave to auto document

Project description

A sphinx extension for behave to auto document.

Setup

To add auto behave to your sphinx modify conf.py by adding auto behave to extensions like so:

extensions = ['..', '..', 'auto_behave']

To enable auto behave’s rst generation modify conf.py by adding the following to the bottom:

from auto_behave.gen_step_rst import generate_docs
generate_docs('abs/path/to/project', 'rel/path/features/dir', 'rel/path/doc/features')

File Layout

Auto behave’s rst generation supports both the standard behave & more custom folder structure layouts.

Standard Behave

features
├── environment.py
├── order.feature
│
└── steps
    ├── add.py
    └── remove.py

Custom Folder Structure

features
├── environment.py
├── order
|   ├── create_order.feature
│   └── steps
|       ├── add.py
|       └── remove.py
|
└── steps
    ├── __init__.py
    ├── navigation.py
    └── common.py

By default behave doesn’t allow you to have step files in different directories outside a single step folder. Being locked to single folder becomes a problem with a large scale project. To get around behave’s limitation within behave’s step directory i.e. features/steps create __init__.py and import all other steps files that are not in this directory i.e.

# features/steps/__init__.py

import features.order.steps.add
import features.order.steps.remove

Usage

You can of course create your own rst for more manual approach by using autobehave directive, like so:

Order Steps
===========

..  autobehave::

    features.order.steps.add
    features.order.steps.remove

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

auto_behave-0.0.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

auto_behave-0.0.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file auto_behave-0.0.3.tar.gz.

File metadata

  • Download URL: auto_behave-0.0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.9

File hashes

Hashes for auto_behave-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3dccf029492807ad31f2027517fe67b07bb5a3c5b1c6159c0727cb11bd2571e0
MD5 3b48e3254fa85d65ce332372076fc1f1
BLAKE2b-256 7ec1c1d7e78adaa47b5e3ebf4b61d5c375e0aa1621ffd58697580d0cad82d939

See more details on using hashes here.

File details

Details for the file auto_behave-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: auto_behave-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.9

File hashes

Hashes for auto_behave-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5323ebda2133725fd4cc8e42b4b5f3943f142ca84d6e5513e2c0384d64c8193c
MD5 6054540b9d9b090130f7f5299e30a4b7
BLAKE2b-256 188309a16045c0948eb3b3e4d221b5d9e578e5dd97f688be477b662f4ccd124d

See more details on using hashes here.

Supported by

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