scenario.scenarioexecution module¶
Scenario execution management.
- class ScenarioExecution¶
Bases:
objectObject that gathers execution information for a scenario.
The scenario execution information is not stored in the base
ScenarioDefinitionclass for user scenario definitions. In order to avoid confusion, the dedicated members and methods are implemented in a separate class:ScenarioExecution.- __init__(definition)¶
- Parameters:
definition – Related scenario definition under execution. May be
Nonewhen theScenarioExecutioninstance is created as a data container only.
- definition¶
Related scenario definition.
- __current_step_definition¶
Current step reference in the scenario step list.
- __next_step_definition¶
Next step reference in the step list. Used when a
scenariodefinition.ScenarioDefinition.goto()call has been made.
- time¶
Time statistics.
- errors¶
Errors.
- warnings¶
Warnings.
- _logger¶
Make this class log as if it was part of the
ScenarioRunnerexecution.
- __repr__()¶
Canonical string representation.
- startsteplist()¶
Initializes the step iterator.
Once the step iterator has been initialized, the
current_step_definitionattribute gives the current step. If the scenario has no step of the kind,current_step_definitionisNoneas a result.The
nextstep()method then moves the iterator forward.
- nextstep()¶
Moves the step iterator forward.
- Returns:
Truewhen a next step is ready,Falseotherwise.
When
nextstep()returnsFalse, thecurrent_step_definitionisNoneas a result.
- setnextstep(step_definition)¶
Arbitrary sets the next step for the step iterator.
Useful for the goto feature.
- Parameters:
step_definition – Next step definition to execute.
- property current_step_definition¶
Current step definition being executed.
Depends on the current active step iterator (see
backtosteptype()).
- property status¶
Scenario execution status.
ExecutionStatus.FAILwhen an exception is set,ExecutionStatus.SUCCESSotherwise.- Returns:
Scenario execution status.
- property step_stats¶
Step statistics computation.
- Returns:
Number of steps executed over the number of steps defined.
- property action_stats¶
Action statistics computation.
- Returns:
Number of actions executed over the number of actions defined.
- property result_stats¶
Expected result statistics computation.
- Returns:
Number of expected results executed over the number of expected results defined.
- __cmp(other)¶
Scenario execution comparison in terms of result criticity.
- Parameters:
other – Other
ScenarioExecutioninstance to compare with.- Returns:
-1 if
selfis less critical thanother,0 if
selfandotherhave the same criticity,1 if
selfis more critical thanother.
- __lt__(other)¶
Checks whether
self<other, i.e.selfstrictly less critical thanother.
- __le__(other)¶
Checks whether
self<=other, i.e.selfless critical than or as critical as``other``.
- __gt__(other)¶
Checks whether
self>other, i.e.selfstrictly more critical thanother.
- __ge__(other)¶
Checks whether
self>=other, i.e.selfmore critical than or as critical as``other``.