TsReport

class TsReport

Represents a report test step.

When executed within a test case, a report test step creates a report entry with the configured information. These are:

  • Column texts for action, name, value, and comment

  • A rating

  • A file attachment

  • A comment

  • A table

The type of the table cells is string. Each cell contains a Python expression. The expressions are evaluated when the test step is executed. The cells of the table in the report will contain the resulting values.

Returned by

AddTag(tag)

Add a specific tag to this step.

Parameters:
tag : str

The tag to be set

ClearTableValues()

Clears all table values.

Clone()

Call this method if you want to use API-objects in multiple contexts, e.g. if you want to insert a specific test step in multiple blocks.

Returns:

A copy of this object

Return type:

TsReport

DeactivateTableVariable()

Deactivates the table variable.

DeleteTranslatedCommentText(language)

Deletes a comment for the test step in the given language.

Parameters:
language : str

Language of the text (‘en_US’, ‘de_DE’, ‘zh_CN’)

DisbableReportComment()

Disable the report comment of the test step.

GetActionColumnText()

Returns the text value of the “action” column.

Returns:

Action column text

Return type:

str

GetActionExpression()

Returns the action column expression.

Returns:

Action column expression

Return type:

str

GetComment()

Returns the comment of the test step in the current test case language.

Returns:

Comment text as shown in the comment tab

Return type:

str

GetCommentColumnText()

Returns the text value of the “comment” column.

Returns:

Comment column text

Return type:

str

GetError()

Returns a list of errors. Note that the error messages depend on the program language ecu.test is set to. Because of that we do not recommend to check against exact error messages, unless you are certain about the respective program language.

Returns:

List of errors

Return type:

list[str]

GetIndex()

Returns the zero based index in the parent.

Returns:

Zero based index

Return type:

integer

GetLineNo()

Returns the test steps line number within its test case.

Returns:

Line number

Return type:

int

GetNameExpression()

Returns the name column expression.

Returns:

Name column expression

Return type:

str

GetNoteExpression()

Returns the note column expression.

Returns:

Note column expression

Return type:

str

GetParameterColumnText()

Returns the text value of the “parameter” column.

Returns:

Parameter column text

Return type:

str

GetParent()

Returns the parent test step.

Returns:

The parent test step or None if it is a top level test step.

Return type:

TestStep

GetReportComment()

Returns the report comment if its activated.

Returns:

Report comment or None

Return type:

str

GetReportVerdict()

Returns the report verdict.

Returns:

Report verdict (One of [‘NONE’, ‘SUCCESS’, ‘INCONCLUSIVE’, ‘FAILED’, ‘ERROR’])

Return type:

str

GetTable()

Returns the table.

Returns:

The table

Return type:

MatrixExpression

GetTableValue(x, y)

Returns the value of the cell specified by x and y.

Parameters:
x : integer

X-Index (column count) of the table

y : integer

Y-Index (row count) of the table

Returns:

Value Expression

Return type:

str

GetTableVariable()

Returns the name of the variable or None, if no variable is set.

Returns:

Name of the variable

Return type:

str

GetTableXDimension()

Returns the X-Dimension (column count) of the table.

Returns:

X-Dimension (column count) of the table

Return type:

integer

GetTableYDimension()

Returns the Y-Dimension (row count) of the table.

Returns:

Y-Dimension (row count) of the table

Return type:

integer

GetTags()

Returns the tags set for this step.

Returns:

A (sorted) list of tags

Return type:

list[str]

GetTestManagementId()

Returns the test management id of the test step.

Returns:

Test step id.

Return type:

str

GetTestStepId()

Returns the test step id.

Returns:

test step id

Return type:

str

GetTranslatedCommentText(language)

Returns the text value of the “comment” column in the given language.

Parameters:
language : str

Language of the requested text (‘en_US’, ‘de_DE’, ‘zh_CN’)

Returns:

Comment column text

Return type:

str

GetType()

Returns the type (class name) of the test step, e.g.

  • “TsPreconditionBlock”

  • “TsWait”

  • “TsIfThenElse”

  • “TsSwitchCase”

  • “TsCaseNode”

Returns:

Type (class name) of the test step

Return type:

str

GetValueColumnText()

Returns the text value of the “value” column in your current test case language.

Returns:

Value column text

Return type:

str

GetValueExpression()

Returns the value column expression.

Returns:

Value column expression

Return type:

str

IsBreakpoint()

Checks whether the test step is a break point.

Returns:

True if test step is a break point, else False

Return type:

boolean

IsContainer()

Returns True, if the test step supports calling GetChildren as well as manipulating the structure of its children. (e. g. via inserting or deleting sub test steps).

Returns:

True if it can contain test steps, else False

Return type:

boolean

IsEnabled()

Returns the state of the test step.

Returns:

True if test step is enabled, otherwise False

Return type:

bool

IsInPostcondition()

Returns True if the test step is located in a postcondition

Returns:

True if the test step is located in a postcondition, else Flase

Return type:

bool

IsInPrecondition()

Returns True if the test step is located in a precondition

Returns:

True if the test step is located in a precondition, else False

Return type:

bool

IsOk()

Returns the internal state of correctness of the test step.

Returns:

True if no problems were found, else False

Return type:

boolean

IsReportCommentEnabled()

Returns true if a report comment is set and activated.

Returns:

True or False

Return type:

bool

IsVisible()

Checks whether the test step is visible. This depends on the test step itself or a parent test step being disabled.

Returns:

True if test step is visible, else False

Return type:

boolean

RemoveTag(tag)

Remove a specific tag from this step.

Parameters:
tag : str

The tag to be removed

SetActionExpression(expr)

Sets the action column expression.

Parameters:
expr : str

Action column expression

SetBreakpoint(enable)

Sets or unsets the test step to act as a break point.

Parameters:
enable : boolean

True if test step is a break point, else False

SetComment(comment)

Sets a comment for the test step in the current test case language.

Parameters:
comment : str

Text to be displayed in the comment tab

SetEnabled(state=True)

Enable or disable the test step.

Parameters:
state : bool

True (Default) to enable, False to disable the test step.

SetNameExpression(expr)

Sets the name column expression.

Parameters:
expr : str

Name column expression

SetNoteExpression(expr)

Sets the note column expression.

Parameters:
expr : str

Note column expression

SetReportComment(comment)

Sets the report comment and automatically activates it.

Parameters:
comment : str

Report comment

SetReportVerdict(verdict)

Sets the report verdict.

Parameters:
verdict : str

The verdict of the report test step (Must be one of [‘NONE’, ‘SUCCESS’, ‘INCONCLUSIVE’, ‘FAILED’, ‘ERROR’])

SetTable(table)

Sets the table.

Parameters:
table

The table

Raises:

ApiError: When the type of the argument is incorrect.

SetTableValue(x, y, value)

Sets the value of the cell specified by x and y.

Parameters:
x : integer

X-Index (column count) of the table

y : integer

Y-Index (row count) of the table

value : str

Value Expression

SetTableVariable(variable)
Sets the name of the variable of which the value will be displayed in the report. Must be

of type ‘Matrix’.

Parameters:
variable : str

Name of the variable

SetTableXDimension(xDimension)

Sets the X-Dimension (column count) of the table. The existing table will be extended or shrinked accordingly. Values that are out of range of the new dimension will be lost.

Parameters:
xDimension : integer

X-Dimension (column count) of the table

SetTableYDimension(yDimension)

Sets the Y-Dimension (row count) of the table. The existing table will be extended or shrinked accordingly. Values that are out of range of the new dimension will be lost.

Parameters:
yDimension : integer

Y-Dimension (row count) of the table

SetTags(tags)

Set the list of tags for this step. The list of tags will be sorted and stored.

Parameters:
tags : list[str]

The list of tags

SetTestManagementId(testManagementId)

Sets the test management id of the test step.

Parameters:
testManagementId : str

Test management id of the test step

SetTranslatedCommentText(comment, language)

Sets a comment for the test step in the given language.

Parameters:
comment : str

Text to be displayed

language : str

Language of the text (‘en_US’, ‘de_DE’, ‘zh_CN’)

SetValueExpression(expr)

Sets the value column expression.

Parameters:
expr : str

Value column expression