Examples and Tutorials for "behave" to simplify use for new developers.
Clone or download
Pull request Compare This branch is even with behave:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.extra/packages
.github
bin
datatype.features
docs.html
docs
features
lib/python
step_matcher.features CLEANUP: Old convention to use register_type(). Jul 10, 2014
tasks
.gitignore
.pycheckrc
.pylintrc
.pythonrc.py
.travis.yml
MANIFEST.in
README.rst
VERSION.txt
behave.ini
index.html
invoke.yaml
py.requirements.txt
setup.cfg
setup.py
setuptools_behave.py
tox.ini

README.rst

behave.example: Examples and Tutorials

Date: 2016-10-22
Category:BDD, testing
License:BSD

behave is a BDD test framework and cucumber-clone for Python. This project provides tutorials and examples how to use behave. It should extends the excellent documentation of behave.

SEE ALSO:
DOCUMENTATION:
REPOSITORIES:

INSTALL

The project provides tutorials and examples. Therefore, it should not be installed. To prepare the local installation, use the following command to install all prerequisites:

pip install -r py.requirements.txt

Snapshots of the behave and parse_type implementations are provided in the directory lib/python/. This directory is automatically used when you use bin/behave to run behave.

HOWTO

Cleanup local workspace:

invoke clean

Run behave tests:

invoke test

or:

bin/behave features/
bin/behave datatype.features/
bin/behave step_matcher.features/

Build Sphinx-based documentation with tutorials:

invoke docs

If invoke is not installed, use the following canned script instead:

bin/invoke command ...

SPECIAL CONFIGURATION

  • The behave PrettyFormatter is replaced with pretty2.SimplePrettyFormatter.

    This formatter implementation avoids cursor-ups while processing steps. ANSI escape cursor-up sequences do not work with sphinxcontrib-ansi when the sphinx-based documentation is generated (experimental feature for colorized behave output support).

  • sphinxcontrib-ansi does not process the following ANSI escape sequences correctly (set-color, set-bold):

    CSI{color_code}mCSI1m
    

    The color is reset in HTML output when set-bold is detected. The following ANSI escape sequence should be used instead:

    CSI{color_code};1m
    

    The behave runner, that is used here, patches the original functionality to use the second solution ("use_ansi_escape_colorbold_composites()").

  • The coloring schema in behave is adapted by setting the environment variable ("grey" is replaced with "white"):

    GHERKIN_COLORS="executing=white:comments=white"
    
  • To disable "ANSI coloring" support for Sphinx, set "ansiterm_supported = False" in "docs/conf.py". Note that this is not necessary on Windows.