TsPackageCall¶
- class TsPackageCall¶
Returned by
- 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:
- DeactivateTimeOption()¶
Deactivates any time option set on the test step. This is equivalent to selecting the option “none” in the test step’s time options menu.
- 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 of this test step.
- Parameters:
- disable : boolean¶
If True the result of this test step will not be reported (optional)
- DisableReportingFor(results)¶
Sets results for which reporting of the test step is to be 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’.
- GetAbsolutePath()¶
Returns the absolute file path of the referenced package.
- Returns:
Absolute file path of the package to be called. None if there is no path to a referenced package.
- Return type:
str
- GetActionColumnText()¶
Returns the text value of the “action” column.
- Returns:
Action column text
- Return type:
str
- GetActiveTimeOptionType()¶
Returns the type of the currently active time option.
- Returns:
Type of active time option (“Timeless”, “Finally”, “TrueForWithin”, “Generally”, “SyncOnly”, “PollingCycleMultiplier”)
- Return type:
string
- 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]
- GetExpectations()¶
Retrieves all expectations for the referenced package.
- Returns:
Dictionary of <expectation variable name, Expectation to be matched> items
- Return type:
dict[str,
Expectation]
- GetIndex()¶
Returns the zero based index in the parent.
- Returns:
Zero based index
- Return type:
integer
- GetLineNo()¶
Returns the line number of the test step inside the test case.
- Returns:
Line number of the test step
- Return type:
int
- GetMappingNames()¶
Returns the names of all mapping items mapped in the test step. Unmapped generic mappings of the called package are not returned. For the mapping item that defines the referenced package, see
GetReferencedPackageMappingName().- Returns:
List of mapping names
- Return type:
list[str]
- GetMappingTarget(name)¶
Returns the target path of the mapping item of the parameterized mapping of the package call.
- Parameters:
- name : str¶
Name of the mapping item
- Returns:
Target path of the mapping item
- Return type:
str
- Raises:
ApiError – If there is no mapping item with the given name
- GetMinimumDuration()¶
Returns the minimum duration of the test step’s time option, if a corresponding option has been set.
- Returns:
The minimum duration, else None
- Return type:
string
- GetMinimumDurationUnit()¶
Returns the unit of the minimum duration of the test step’s time option, if a corresponding option has been set.
- Returns:
The unit of the minimum duration, else None
- Return type:
string
- GetPackageParameter(paramName)¶
Retrieves the expression assigned to a package parameter.
- Parameters:
- paramName : str¶
Name of the parameter
- Returns:
Expression assigned to the parameter
- Return type:
str
- Raises:
ApiError – If paramName does not exist.
- GetPackageParameters()¶
Retrieves all package parameters with its expressions.
- Returns:
Dictionary of <parameter name, expression> items
- Return type:
dict[str, str]
- GetPackageReturn(varInternal)¶
Retrieves the variable name assigned to a package return variable name of the referenced package.
- Parameters:
- varInternal : str¶
Name of the return variable of the referenced package
- Returns:
Assigned variable of the calling package. Empty string if there is not any variable assigned.
- Return type:
str
- GetPackageReturns()¶
Retrieves all return variable assignments.
- Returns:
Dictionary of <return variable name of the referenced package, variable name of the calling package> items
- Return type:
dict[str, 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:
- GetPath()¶
Returns the path of the package referenced in the package mapping item used for this package call. For local packages and packages in referenced library workspaces this path has ‘<namespace.packages>’ notation. For generic package calls this path is ‘PACKAGE’. Any other calls are regarded to be external - the absolute package path is returned.
- Returns:
Target path of the package to be called. None if there is no path to a referenced package.
- Return type:
str
- Raises:
ApiError – If there is no local package mapping in the package
- GetPollingCycle()¶
Returns the polling cycle of the test step’s time option, if a corresponding option has been set.
- Returns:
The polling cycle, else None
- Return type:
string
- GetPollingCycleUnit()¶
Returns the unit of the polling cycle of the test step’s time option, if a corresponding option has been set.
- Returns:
The unit of the polling cycle, else None
- Return type:
string
- GetReferencedPackage()¶
Returns the referenced package. If the path contains global constants, their current values are used.
- Returns:
The referenced package. None if there is no path to a referenced package.
- Return type:
- Raises:
ApiError – If the referenced package does not exist.
- GetReferencedPackageMappingName()¶
Returns the reference name of the package mapping item used by this test step. For the mapping items used by the called package, see
GetMappingNames().- Returns:
Reference name of the used mapping item.
- Return type:
str
- GetReportDisablingResults()¶
Returns all results for which 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
- GetTimeout()¶
Returns the timeout of the test step’s time option, if a corresponding option has been set.
- Returns:
The timeout else None
- Return type:
string
- GetTimeoutUnit()¶
Returns the unit of the timeout of the test step’s time option, if a corresponding option has been set.
- Returns:
The unit of the timeout else None
- Return type:
string
- 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
- 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.
- SetExpectations(expectations)¶
Set package expectations for return variables.
- Parameters:
- expectations¶
Dictionary of <parameter name, Expectation> items
- Raises:
TypeError – If any expectation is not derived from Expectation
- SetMappingTarget(name, target)¶
For the referenced package, sets the target path of the parameterized mapping item with the given name. There is no check whether a mapping item with the given name exists within the referenced package. If a check is required, the referenced package can be examined separately using the PackageApi.
- SetPackageParameter(paramName, paramValue)¶
Assigns a value to a package parameter. If there is no parameter with the given name yet, an additional entry is added.
- SetPackageParameters(paramDict)¶
Replaces all package parameters by the given paramDict.
- Parameters:
- paramDict : dict[str, str]¶
Dictionary of <parameter name, expression> items
- SetPackageReturn(varInternal, varExternal)¶
Assigns a variable name of the calling package to a return variable name of the referenced package.
- SetPackageReturns(returnDict)¶
Replaces package returns by the given returnDict.
- Parameters:
- returnDict : dict[str, str]¶
Dictionary of <return variable name of the referenced package, variable name of the calling package> items
- 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
-
SetTimeOptionOnlySynchronization(timeout, pollingCycle=
None, timeoutUnit='ms', pollingCycleUnit='ms')¶ Sets the test step’s time option to “only synchronization”.
- SetTimeOptionPollingCycleMultiplier(pollingCycleMultiplier)¶
Sets the test step’s time option to “polling cycle multiplier”. This option must only be used when inserting the test step into a Multi-Check!
- Parameters:
- pollingCycleMultiplier : string¶
The polling cycle multiplier to be used.
-
SetTimeOptionTrueForAtLeast(minimumDuration, pollingCycle=
None, minimumDurationUnit='ms', pollingCycleUnit='ms')¶ Sets the test step’s time option to “true for at least”.
-
SetTimeOptionTrueForAtLeastWithin(minimumDuration, timeout, pollingCycle=
None, timeoutUnit='ms', minimumDurationUnit='ms', pollingCycleUnit='ms')¶ Sets the test step’s time option to “true for at least … within …”.
- Parameters:
- minimumDuration : string¶
The minimum duration to be used
- timeout : string¶
The timeout to be used
- pollingCycle : string¶
Optional polling cycle to be used
- timeoutUnit : string¶
Optional unit for the timeout (ms, s, min, h or d)
- minimumDurationUnit : string¶
Optional unit for the minimum duration (ms, s, min, h or d)
- pollingCycleUnit : string¶
Optional unit for the polling cycle (ms, s, min, h or d)
-
SetTimeOptionWaitUntilTrue(timeout, pollingCycle=
None, timeoutUnit='ms', pollingCycleUnit='ms')¶ Sets the test step’s time option to “wait until true”.
- SetTranslatedCommentText(comment, language)¶
Sets a comment for the test step in the given language.
- UnsetPackageReturn(varInternal)¶
Removes an assignment of a variable name of the calling package to a return variable name of the referenced package.
- Parameters:
- varInternal : str¶
Return variable name of the referenced package