TsWriteAudio¶
- class TsWriteAudio¶
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:
- 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’)
- GetActionColumnText()¶
Returns the text value of the “action” column.
- 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]
- GetFileReferenceValue()¶
Gets the path of the file if a file reference is configured for playback. Returns None if no file reference value is defined.
- Returns:
Path of referenced file
- 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
- GetMappingItemReferenceName()¶
Returns the unique reference name of the mapping item used by this test step.
- Returns:
Reference name of used mapping item
- Return type:
str
- GetObjectValue()¶
Gets the text representation of the expression if a python object is configured for playback. Returns None if no object value is defined.
- Returns:
Path of referenced file
- 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:
-
GetRepresentation(axis=
'z')¶ Returns the representation of a certain axis of the accessed test quantity.
- Parameters:
- axis : str¶
Axis to set representation for (x, y, z)
- Returns:
Representation for axis (PHYS, TEXT, RAW, BITS)
- Return type:
str
- GetTTSValue()¶
Gets parameters for a configured text-to-speech playback. Returns None if no text-to-speech value is defined.
- Returns:
Returns a dictionary containing the configured text, serviceId, voiceName, voiceLanguage, voiceGender, pitch, speed.
- Return type:
dict[str, 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
- 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
-
GetUnit(axis=
'z')¶ Returns the unit of a certain axis of the accessed test quantity.
- Parameters:
- axis : str¶
Axis to set unit for (x, y, z)
- Returns:
Unit for axis
- 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
- 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.
- SetFileReferenceValue(path)¶
Sets file reference for playback from file.
- Parameters:
- path : str¶
Path for file reference
- SetObjectValue(expression)¶
Sets the expression if a python object is configured for playback.
- Parameters:
- expression : str¶
Python expression resulting in an AudioBlock object
-
SetRepresentation(representation=
'PHYS', axis='z')¶ Sets the representation of a certain axis of the accessed test quantity.
-
SetTTSValue(text, serviceId=
None, voiceName=None, voiceLanguage=None, voiceGender=None, pitch='0.0', speed='1.0')¶ Sets audio source to text-to-speech with specified parameters. If service or voice parameters are set to None, the setting from the test configuration is used. A list of available voices on the current system can be retrieved using the internal API’s MultimediaApi.GetAvailableTTSVoices(). Expression parameters need to be entered as strings representing python expressions. For example, the text parameter may be a simple sentence such as ‘“Hello.”’ but can also contain a test case variable testerName as ‘“Hello “ + testerName’.
- Parameters:
- text : str¶
Text to be transformed to speech as expression.
- serviceId : str¶
ID of text-to-speech service.
- voiceName : str¶
Name of the voice. Has to be available for specified serviceId.
- voiceLanguage : str¶
Language of voice as language code, e.g. ‘en’, ‘de’
- voiceGender : str¶
Gender of voice (‘MALE’, ‘FEMALE’, ‘OTHER’, ‘UNDEFINED’)
- pitch : str¶
Pitch of speech as expression.
- speed : str¶
Speed of speech as expression. Evaluated value must be larger than 0.
- 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