Coder Social home page Coder Social logo

behave's Introduction

Behave

Build Status

behave is behaviour-driven development, Python style.

Behavior-driven development (or BDD) is an agile software development technique that encourages collaboration between developers, QA and non-technical or business participants in a software project.

behave uses tests written in a natural language style, backed up by Python code.

First, install *behave*.

Now make a directory called "example". In that directory create a file called "example.feature" containing:

Feature: showing off behave

  Scenario: run a simple test
     Given we have behave installed
      when we implement a test
      then behave will test it for us!

Make a new directory called "example/steps". In that directory create a file called "example.py" containing:

from behave import *

@given('we have behave installed')
def impl(context):
    pass

@when('we implement a test')
def impl(context):
    assert True is not False

@then('behave will test it for us!')
def impl(context):
    assert context.failed is False

Run behave:

% behave
Feature: showin off behave # example/example.feature:1

  Scenario: run a simple test        # example/example.feature:3
    Given we have behave installed   # example/steps/example.py:3
    When we implement a test         # example/steps/example.py:7
    Then behave will test it for us! # example/steps/example.py:11

1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
3 steps passed, 0 failed, 0 skipped, 0 undefined

Now, continue reading to learn how to the most of behave. To get started, we recommend the tutorial and then the feature testing language and api references.

Project Info

Category Hyperlink
Documentation: http://packages.python.org/behave/ (or: https://behave.readthedocs.org/)
Download: http://pypi.python.org/pypi/behave (or: github archive)
Development: https://github.com/behave/behave
Issue Tracker: https://github.com/behave/behave/issues
Changelog: CHANGES.rst

More Information

  • behave.example: Behave Examples and Tutorials (docs, executable examples).

Testing Domains

Behave and other BDD frameworks allow you to provide step libraries to reuse step definitions in similar projects that address the same problem domain.

Support of the following testing domains is currently known:

Testing Domain Name Description
Command-line behave4cmd Test command-line tools, like behave, etc. (coming soon).
Web Apps django-behave Test Django Web apps with behave.
Web, SMS, ... behaving Test Web Apps, Email, SMS, Personas (step library).

behave's People

Contributors

jeamland avatar r1chardj0n3s avatar jenisys avatar katherinesun avatar vrutkovs avatar florentx avatar caphrim007 avatar johbo avatar lrowe avatar msabramo avatar alexzak avatar rwillmer avatar

Watchers

Gary Monson avatar James Cloos 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.