scenario.stepexecution module

Step execution management.

class StepExecution

Bases: object

Step execution information.

Note

Due to the *goto* feature, a step may be executed several times. By the way, a StepDefinition instance may own multiple instances of StepExecution.

__init__(definition, number)

Initializes a new step execution for the given step definition.

Starts the execution time with the current date.

Parameters:
  • definition – Step definition this instance describes an execution for.

  • number – Execution number. See number.

definition

Owner step reference.

number

Step execution number.

Execution number of this step execution within the steps executions of the related scenario. Starting from 1, as displayed to the user.

current_action_result_definition

Current action or expected result under execution.

Differs from __current_action_result_definition_index in that this reference can be set to None when the action / expected result execution is done.

time

Time statistics.

errors

Error.

warnings

Warnings.

__current_action_result_definition_index

Current action or expected result index under execution.

__repr__()

Canonical string representation.

getnextactionresultdefinition()

Retrieves the next action/result definition to execute.

Returns:

Next ActionResultDefinition instance to execute.

Sets the current_action_result_definition reference by the way.

getstarttime()

Retrieves the starting time of the step execution.

Returns:

Step execution start time.

getendtime(expect)

Retrieves the ending time of the step execution.

Parameters:

expectTrue when this step execution is expected to be terminated. Otherwise, the current time is returned.

Returns:

Step execution end time, or current time.

static actionstats(definition)

Computes action statistics for the given step definition.

Parameters:

definition – Step definition to compute action statistics for.

Returns:

Action statistics of the step.

static resultstats(definition)

Computes expected result statistics for the given step definition.

Parameters:

definition – Step definition to compute expected result statistics for.

Returns:

Expected result statistics of the step.