TsBlock

class TsBlock

Api- of the block structure test step.

Returned by

AddTag(tag)

Add a specific tag to this step.

Parameters:
tag : str

The tag to be set

AppendTestStep(testStep)

Adds a test step at the end of the container.

Parameters:
testStep

Test step to be added

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:

TsBlock

DeleteTranslatedActionColumnText(language)

Deletes the text value to be displayed in the action column of the test case editor in the given language.

Parameters:
language : str

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

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’)

DeleteTranslatedParameterColumnText(language)

Deletes the text value to be displayed in the parameter column of the test case editor in the given language.

Parameters:
language : str

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

DeleteTranslatedValueColumnText(language)

Deletes the text value to be displayed in the value column of the test case editor in the given language.

Parameters:
language : str

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

DisableReporting(disable=True)

Disables or enables the reporting this test step.

Parameters:
disable : boolean

If True the result of this test step will not be reported (optional)

DisableReportingFor(results)

Sets for which results reporting of the test step is disabled.

Parameters:
results : list[str]

List of results for which the test step will not be reported. Valid results are: u’NONE’, u’SUCCESS’, u’INCONCLUSIVE’, u’FAILED’, u’ERROR’

GetAbortCode()

Returns the abort code of the block.

Returns:

Abort code

Return type:

str

GetAbortComment()

Returns the abort comment of the block.

Returns:

Abort comment

Return type:

str

GetAbortCondition()

Returns the condition under which the test case will be terminated or aborted.

Returns:

one of [‘ERROR’, ‘ERROR_OR_FAILED’, ‘ERROR_OR_FAILED_OR_INCONCLUSIVE’]

Return type:

str

GetActionColumnText()

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

Returns:

Action column text

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

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

GetReportDisablingResults()

Returns for which results reporting of the test step is disabled.

Returns:

List of results for which the test step will not be reported

Return type:

list[str]

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

GetTestSteps(skipDisabledSteps=True, recursive=False, whiteList=None, blackList=None)

Returns the children of the test step.

Parameters:
skipDisabledSteps : boolean

Defines whether disabled test steps should be excluded.

recursive : boolean

Specifies whether only the direct children of the test step or recursively all test steps from the complete test step tree should be returned.

whiteList : list[str]

If specified, only those test steps whose class name is on this list are returned.

blackList : list[str]

If specified, only those test steps whose class name is not on this list are returned.

Returns:

List with all children test steps

Return type:

list[TestStep]

GetTranslatedActionColumnText(language)

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

Parameters:
language : str

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

Returns:

Action column text

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

GetTranslatedParameterColumnText(language)

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

Parameters:
language : str

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

Returns:

Value column text

Return type:

str

GetTranslatedValueColumnText(language)

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

Parameters:
language : str

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

Returns:

Value 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

InsertTestStep(testStep, position)

Adds a test step at a certain position of the container.

Parameters:
testStep

Test step to be added

position : integer

Target index of child beginning with 0

IsBreakpoint()

Checks whether the test step is a break point.

Returns:

True if test step is a break point, else False

Return type:

boolean

IsConditionalAbortEnabled()

Returns whether the block will abort the test case if the condition is met.

Returns:

Conditional abort enabled

Return type:

boolean

IsConditionalEndEnabled()

Returns whether the block will terminate the test case if the condition is met.

Returns:

Conditional end enabled

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

IsGeneratedByAgent()

Returns whether the test steps in this block were generated by the ecu.test agent.

Returns:

True if generated by ecu.test agent, False otherwise

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

IsOverrideAbortInfoEnabled()

Returns if the block override abort information of underlying test steps.

Returns:

Conditional abort enabled

Return type:

boolean

IsReportingDisabled()

Returns whether reporting of this test step is disabled.

Returns:

True if reporting is disabled

Return type:

boolean

IsUserInteractionEnabled()

Returns if the block is set to be a user interaction.

Returns:

User interaction status

Return type:

boolean

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

IsWaitUntilSpeechOutputFinishedEnabled()

Returns whether to wait for the end of speech output before executing the next contained test step.

Returns:

True if waiting for the end of speech output, otherwise False

Return type:

boolean

RemoveTag(tag)

Remove a specific tag from this step.

Parameters:
tag : str

The tag to be removed

RemoveTestStep(testStep)

Removes a test step from the container.

Parameters:
testStep

Test step to be removed

Raises:

ApiError:

  • When the test step is not a direct child of the container

  • When the test step is not editable

SetAbortCode(code)

Sets the abort code of the block.

Parameters:
code : str

Abort code

SetAbortComment(comment)

Sets the abort comment of the block.

Parameters:
comment : str

Abort comment

SetAbortCondition(condition)

Sets the condition under which the test case will be terminated or aborted. Must be one of [‘ERROR’, ‘ERROR_OR_FAILED’, ‘ERROR_OR_FAILED_OR_INCONCLUSIVE’], otherwise the command raises an error.

Parameters:
condition : str

Abort condition

SetActionColumnText(text)

Sets the text value to be displayed in the action column of the test case editor in your current test case language.

Parameters:
text : str

Text to be displayed

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

SetConditionalAbort(abort=True)

Sets whether the block will abort the test case if the condition is met.

Parameters:
abort : boolean

Conditional abort status

SetConditionalEnd(end=True)

Sets whether the block will terminate the test case if the condition is met.

Parameters:
end : boolean

Conditional end status

SetEnabled(state=True)

Enable or disable the test step.

Parameters:
state : bool

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

SetOverrideAbortInfo(override)

Sets the override abort information status.

Parameters:
override : boolean

Override abort information status

SetParameterColumnText(text)

Sets the text value to be displayed in the parameter column of the test case editor.

Parameters:
text : str

Text to be displayed

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

SetTranslatedActionColumnText(text, language)

Sets the text value for the action column of the test case editor in the given language.

Parameters:
text : str

Text to be displayed

language : str

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

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’)

SetTranslatedParameterColumnText(text, language)

Sets the text value to be displayed in the parameter column of the test case editor in the given language.

Parameters:
text : str

Text to be displayed

language : str

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

SetTranslatedValueColumnText(text, language)

Sets the text value to be displayed in the value column of the test case editor in the given language.

Parameters:
text : str

Text to be displayed

language : str

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

SetUserInteraction(interactive=True)

Sets if the block is user interactive.

Parameters:
interactive : boolean

User interaction status

SetValueColumnText(text)

Sets the text value to be displayed in the value column of the test case editor in your current test case language.

Parameters:
text : str

Text to be displayed

SetWaitUntilSpeechOutputFinished(wait=True)

Sets whether to wait for the end of the speech output before executing the next contained test step.

Parameters:
wait : boolean

True if the end should be awaited, otherwise False.