TsAssertion¶
- class TsAssertion¶
Returned by
- 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:
- 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’)
-
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’
- GetActionColumnText()¶
Returns the text value of the “action” column.
- Returns:
Action column text
- Return type:
str
- GetCheckErrorLog()¶
Returns whether the ERROR-Log is checked for an expression.
- Returns:
The ERROR-Log is checked
- Return type:
boolean
- GetCheckErrorMessage()¶
Returns whether the error messages are checked for an expression.
- Returns:
The error messages are checked
- Return type:
boolean
- GetCheckExpectedVerdict()¶
Returns whether the verdict is checked for an expected value.
- Returns:
The verdict is checked
- Return type:
boolean
- GetCheckMaxExecutionTime()¶
Returns whether the execution time is checked against a max value.
- Returns:
The max execution time is checked
- Return type:
boolean
- GetCheckMinExecutionTime()¶
Returns whether the execution time is checked against a min value.
- Returns:
The min execution time is checked
- Return type:
boolean
- GetCheckOutLog()¶
Returns whether the OUT-Log is checked for an expression.
- Returns:
The OUT-Log is checked
- Return type:
boolean
- 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]
- GetErrorLogExpr()¶
Returns the expression the ERROR-Log is checked against.
- Returns:
The log expression
- Return type:
str
- GetErrorMessageExpr()¶
Returns the expression for the expected error message.
- Returns:
The error message expression
- Return type:
str
- GetExpectedVerdict()¶
Returns the expected verdict. Possible values are:
‘NONE’
‘SUCCESS’
‘INCONCLUSIVE’
‘FAILED’
‘ERROR’
A list of these values is also possible.
- Returns:
The expected verdict
- Return type:
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
- GetMaxExecutionTimeExpr()¶
Returns the max value the execution time is checked against.
- Returns:
The max execution time expression
- Return type:
str
- GetMaxExecutionTimeUnit()¶
Returns the unit for the max execution time. Possible values are:
‘min’
‘s’
‘ms’
‘h’
‘d’
- Returns:
The max execution time unit
- Return type:
str
- GetMinExecutionTimeExpr()¶
Returns the min value the execution time is checked against.
- Returns:
The min execution time expression
- Return type:
str
- GetMinExecutionTimeUnit()¶
Returns the unit for the min execution time. Possible values are:
‘min’
‘s’
‘ms’
‘h’
‘d’
- Returns:
The min execution time unit
- Return type:
str
- GetOutLogExpr()¶
Returns the expression the OUT-Log is checked against.
- Returns:
The log 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:
- 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]
- 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
- 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
- IsReportingDisabled()¶
Returns whether reporting of this test step is disabled.
- Returns:
True if reporting is disabled
- 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
- 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
- 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
- SetCheckErrorLog(checkErrorLog)¶
Sets whether the ERROR-Log is checked for an expression.
- Parameters:
- checkErrorLog : boolean¶
The ERROR-Log is checked
- SetCheckErrorMessage(checkErrorMessage)¶
Sets whether the error messages are checked for an expression.
- Parameters:
- checkErrorMessage : boolean¶
The error messages are checked
- SetCheckExpectedVerdict(checkVerdict)¶
Sets whether the verdict is checked for an expected value.
- Parameters:
- checkVerdict : boolean¶
The verdict is checked
- SetCheckMaxExecutionTime(checkMaxExecutionTime)¶
Sets whether the execution time is checked against a max value.
- Parameters:
- checkMaxExecutionTime : boolean¶
The max execution time is checked
- SetCheckMinExecutionTime(checkMinExecutionTime)¶
Sets whether the execution time is checked against a min value.
- Parameters:
- checkMinExecutionTime : boolean¶
The min execution time is checked
- SetCheckOutLog(checkOutLog)¶
Sets whether the OUT-Log is checked for an expression.
- Parameters:
- checkOutLog : boolean¶
The OUT-Log is checked
- 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.
- SetErrorLogExpr(errorLogExpr)¶
Sets the expression the ERROR-Log is checked against.
- Parameters:
- errorLogExpr : str¶
The log expression
- SetErrorMessageExpr(errorMessageExpr)¶
Sets an expression for an expected error message.
- Parameters:
- errorMessageExpr : str¶
The error message expression
- SetExpectedVerdict(verdict)¶
Sets the expected verdict. Possible values are:
‘NONE’
‘SUCCESS’
‘INCONCLUSIVE’
‘FAILED’
‘ERROR’
A list of these values is also valid.
- Parameters:
- verdict : str¶
The expected verdict
- SetMaxExecutionTimeExpr(maxExecutionTimeExpr)¶
Sets the max value the execution time is checked against.
- Parameters:
- maxExecutionTimeExpr : str¶
The max execution time expression
- SetMaxExecutionTimeUnit(maxExecutionTimeUnit)¶
Sets the unit for the max execution time. Possible values are:
‘min’
‘s’
‘ms’
‘h’
‘d’
- Parameters:
- maxExecutionTimeUnit : str¶
The max execution time unit
- Raises:
ApiError – If maxExecutionTimeUnit is not a valid unit
- SetMinExecutionTimeExpr(minExecutionTimeExpr)¶
Sets the min value the execution time is checked against.
- Parameters:
- minExecutionTimeExpr : str¶
The min execution time expression
- SetMinExecutionTimeUnit(minExecutionTimeUnit)¶
Sets the unit for the min execution time. Possible values are:
‘min’
‘s’
‘ms’
‘h’
‘d’
- Parameters:
- minExecutionTimeUnit : str¶
The min execution time unit
- Raises:
ApiError – If minExecutionTimeUnit is not a valid unit
- SetOutLogExpr(outLogExpr)¶
Sets the expression the OUT-Log is checked against.
- Parameters:
- outLogExpr : str¶
The log expression
- SetTags(tags)¶
Set the list of tags for this step. The list of tags will be sorted and stored.
- Parameters:
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