Giter Club home page Giter Club logo

auto_behave's Introduction

Auto Behave

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_step_rst_files
generate_step_rst_files('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

auto_behave's People

Contributors

b-ran avatar

Stargazers

Fabricio Magalhães Sena avatar  avatar

Watchers

James Cloos avatar Andrew Preston avatar Daniel Johnston avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.