TestCenter Reference
TestSupport.BDD Namespace Reference

Classes

class  _BDDContext
 

Functions

def Given ()
 
def GivenClause (func)
 
def WhenClause (func)
 
def ThenClause (func)
 

Function Documentation

◆ Given()

def TestSupport.BDD.Given ( )
Initiates a sentence describing a desired behavior.

Creates and returns the context object for the test.

Definition at line 64 of file BDD.py.

◆ GivenClause()

def TestSupport.BDD.GivenClause (   func)
Decorator for defining a Given clause.

The first argument that is passed to the decorated function is the
context object. Custom parameters are passed to the decorated
function after the context object.

The decorated function always returns the context object.

Example:
@GivenClause
def a_precondition(testContext):
    # perform the setup of the test, e.g. by parameterizing a TestPattern
    # module

Definition at line 71 of file BDD.py.

◆ ThenClause()

def TestSupport.BDD.ThenClause (   func)
Decorator for defining a Then clause.

The first argument that is passed to the decorated function is the
context of the test case. Custom parameters are passed to the decorated
function after the context.

The decorated function always returns the context object.

Example:
@ThenClause
def something_happens(testContext):
    # check for the expected behavior, e.g. by comparing a field value
    # with an expected value

Definition at line 104 of file BDD.py.

◆ WhenClause()

def TestSupport.BDD.WhenClause (   func)
Decorator for defining a When clause.

The first argument that is passed to the decorated function is the
context of the test case. Custom parameters are passed to the decorated
function after the context.

The decorated function always returns the context object.

Example:
@WhenClause
def you_do_something(testContext):
    # do whatever shall result in a certain behavior, e.g. touch a field

Definition at line 88 of file BDD.py.