Previous topic

Base

Next topic

CData

This Page

Case

Module: case

Author: arjs.net

License: http://opensource.org/licenses/mit-license.html; year=2013,2014; copyright holders=arjs.net

Module for test case

class case.After(name)

After: After sequence; runs after each scenario; except Setup and Cleanup

__init__(name)
Parameters:name (str) – Name of the sequence
Return type:After
class case.Before(name)

Before: Before sequence; runs before each scenario; except Setup and Cleanup

__init__(name)
Parameters:name (str) – Name of the sequence
Return type:Before
class case.Case(name)

Case: Base for Feature, Sequence and Step classes

__init__(name)
Parameters:name (str) – Name of the Case
Return type:object
class case.Cleanup(name)

Cleanup: Cleanup sequence; runs after all steps

__init__(name)
Parameters:name (str) – Name of the sequence
Return type:Cleanup
class case.Feature(name)

Feature: Class for all feature specific things

__call__()
Return type:None

Execute the objects standard tasks

Raises Exception:
 
__init__(name)
Parameters:name (str) – Name of the feature
Return type:Feature
class case.Given(name, values=None)

Given: Given step

__init__(name, values=None)
Parameters:
  • name (str) – Name of the step
  • values ({}) – Values for the outline
Return type:

Then

class case.Scenario(name)

Scenario: Scenario sequence; runs the actual scenario

__init__(name)
Parameters:name (str) – Name of the sequence
Return type:Scenario
class case.Sequence(name)

Sequence: Base Class for all sequence related classes

__call__(execute=True)
Parameters:execute (bool) – Specifies if the sequence should be skipped
Returns:
Return type:None

Execute the objects standard tasks

__init__(name)
Parameters:name (str) – Name of the sequence
Return type:Sequence
handlesequence(execute, example, first)
Parameters:
  • execute (bool) – Execute or Skip
  • example ([]) – Example array in case of an outline scenario
  • first (bool) – Signals if it is the first execution
Return type:

bool

Helper method to execute a sequence

class case.Setup(name)

Setup: Setup sequence; runs before all steps

__init__(name)
Parameters:name (str) – Name of the sequence
Return type:Setup
class case.Step(name, values=None)

Step: Base class for the actual steps

__call__(execute=True, systemout=None)
Parameters:
  • execute (bool) – Execute of skip
  • systemout ([]) – Array for the output information
Returns:

Return type:

bool

Execute the objects standard tasks

Raises Exception:
 
__init__(name, values=None)
Parameters:
  • name (str) – Name of the step
  • values ({}) – The actual values for an outline scenario
Return type:

Step

class case.Then(name, values=None)

Then: Then step

__init__(name, values=None)
Parameters:
  • name (str) – Name of the step
  • values ({}) – Values for the outline
Return type:

Then

class case.When(name, values=None)

When: When step

__init__(name, values=None)
Parameters:
  • name (str) – Name of the step
  • values ({}) – Values for the outline
Return type:

Then

case.calculatems(timediff)
Parameters:timediff (str) –
Returns:
Return type:str

Returns a string with the miliseconds

case.given(text)
Parameters:text (str) – Name of the actual step
Returns:
Return type:function

Marker for a given implementation

case.replaceconstants(line)
Parameters:line (str) – Line with constants
Return type:str

Replace constants within a line

case.replaceenvironments(line)
Parameters:line (str) – Line with environment value
Return type:str

Replace an environment value within a line

case.replacevariables(line, values)
Parameters:
  • line (str) – Line with variables
  • values ([]) –
Return type:

str

Replace variables within a line

case.showinfo(color, text, indent='')
Parameters:
  • color (int) – Color code
  • text (str) – Text to display
  • indent (str) – Indent to use
Return type:

None

Outputs a color coded, if possible, string of information

case.showstats()
Return type:None

Outputs the statistics

case.then(text)
Parameters:text (str) – Name of the actual step
Returns:
Return type:function

Marker for a then implementation

case.when(text)
Parameters:text (str) – Name of the actual step
Returns:
Return type:function

Marker for a when implementation

case.writereport(filename)
Parameters:filename (str) – junit report filename
Return type:None

Write the junit report