scenario.scenarioreport module

Statistics class module.

SCENARIO_REPORT

Main instance of ScenarioReport.

class ScenarioReport

Bases: Logger

JSON report generator.

__init__()

Configures logging for the ScenarioReport class.

_json_path

JSON report path being written or read.

writejsonreport(scenario_definition, json_path)

Generates the JSON report output file for the given scenario execution.

Parameters:
  • scenario_definition – Scenario to generate the JSON report for.

  • json_path – Path to write the JSON report into.

Returns:

True for success, False otherwise.

readjsonreport(json_path)

Reads the JSON report file.

Parameters:

json_path – JSON file path to read.

Returns:

Scenario data read from the JSON report file. None when the file could not be read, or its content could not be parsed successfully.

_scenario2json(scenario_definition, is_main)

Scenario report JSON generation.

Parameters:
  • scenario_definition – Scenario to generate the JSON report for.

  • is_main – True for the main scenario, False otherwise.

Returns:

JSON report object.

_json2scenario(json_scenario)

Scenario data reading from JSON report.

Parameters:

json_scenario – Scenario JSON report to read.

Returns:

Scenario data.

_step2json(step_definition)

Generates the JSON report for a step.

Parameters:

step_definition – Step definition (with execution) to generate the JSON report for.

Returns:

JSON report object.

_json2step(json_step_definition)

Step reading from JSON report.

Parameters:

json_step_definition – Step definition JSON report to read.

Returns:

StepDefinition data.

_actionresult2json(action_result_definition)

Generates the JSON report for an action / expected result.

Parameters:

action_result_definition – Action or expected result to generate the JSON report for.

Return JSON:

JSON report object.

_json2actionresult(json_action_result_definition)

Action / expected result reading from JSON report.

Parameters:

json_action_result_definition – Action / expected result JSON report to read.

Returns:

ActionResultDefinition data.