Skip to content

Recording test step status

When writing tests, you can use tth_record test step to create a record of the status of that step. The record is saved into the file that is attached to the Allure report. The status of the record is the result of assertions that it contains. For each test that has at least one tth_record call, a file containing statuses of all records that the test contains is generated. When a report is uploaded to Typhoon Test Hub, it processes each file with statuses of records (for each test) and allows their observation in the Results map page as Individual Assertions.

When calling tth_record following two parameters are provided:

  1. Record identifier (str, mandatory) - unique identifier of the record that will be shown in the Results map page
  2. Record message (str, optional) - message that is shown in the Allure report as a step during the test execution

Record identifier is a mandatory parameter, while record message is optional. If the record message parameter is not provided, the record identifier value is used as the default value.

The following code demonstrates the usage of tth_record:

from tth.data import tth_record


def test_example():
    with tth_record('record_id', 'record_message'):
        assert 'Test' in 'Testhub'

    assert 'hub' in 'Testhub'

tth_record

Adds new step in allure report that organizes more functions and report messages in one logical group. It can be viewed as tool for better report organization.

Parameters:

Name Type Description Default
record_id str

identifier of step

required
record_message str

message that is shown in Allure report; default value is record_id value

None

Returns:

Name Type Description
step TestRecord

Allure report step with additional attributes

Raises:

Type Description
InvalidDataException

Invalid arguments provided