Project¶
- class Project¶
Returned by
- Attributes¶
Returns access to the package attributes definitions specified within the parameter set and the referenced package attribute definition files.
- Returns:
Package attribute interface of the parameter set
- Return type:
- GlobalConstants¶
Returns access to the global constants specified on the project component.
- Returns:
Global constants interface of the project component
- Return type:
- MappingFiles¶
Returns access to the mapping file list
- Returns:
Mapping file list object
- Return type:
- PackageParameters¶
Returns access to the package parameters specified on the project component.
- Returns:
Package parameters interface of the project component
- Return type:
- ActivateAbortOnSubprojectAbort()¶
Activates abort of whole project on abort of subprojects.
- ActivateAutomaticValueRestore()¶
Activates value restore of test quantities after the execution of every Package.
- ActivateIndependentSubprojectExecution()¶
Activates independent execution of subprojects.
- AppendComponent(component)¶
Adds a previously created component at the end of the project.
- Parameters:
- component¶
The project component to be appended
- 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:
- Close()¶
Closes the project. After closing the project it can not be modified/accessed anymore.
- DeactivateAbortOnSubprojectAbort()¶
Deactivate abort of whole project on abort of subprojects.
- DeactivateAutomaticValueRestore()¶
Deactivate value restore of test quantities after the execution of every Package.
- DeactivateIndependentSubprojectExecution()¶
Deactivate independent execution of subprojects.
-
GetAllComponents(skipDisabled=
True)¶ Returns all components of the project
- Parameters:
- skipDisabled : boolean¶
Defines whether disabled components should be excluded.
- Returns:
Project components
- Return type:
list[
ProjectComponent]
-
GetAnalysisPackageCalls(skipDisabled=
True, noParameterSets=False)¶ Returns all analysis package calls of the project.
- Parameters:
- Returns:
Package calls
- Return type:
list[
AnalysisPackageCall]
- GetComponentByLineNo(lineNo)¶
Returns the component at a given line number of the project
- Parameters:
- lineNo : int¶
Line number of component to be returned
- Returns:
Project component
- Return type:
- GetComponents()¶
Returns all direct children of the project.
- Returns:
List with all children components
- Return type:
list[
ProjectComponent]
-
GetConfigChanges(skipDisabled=
True)¶ Returns all config changes of the project.
- Parameters:
- skipDisabled : boolean¶
Defines whether disabled config changes should be excluded.
- Returns:
Config changes
- Return type:
list[
ConfigChange]
- GetCustomRetryCondition()¶
Returns the condition of the custom retries. Returns one of the following:
‘ERROR’
‘FAILED’
‘ERROR/FAILED’
- Returns:
The condition of the custom retry
- Return type:
str
- GetCustomRetryCount()¶
Returns the number of the retries defined on the project component.
- Returns:
Number of the custom retries
- Return type:
integer
- GetDescription()¶
Returns the description of the project.
- Returns:
description text
- Return type:
str
- GetErrorRecoveryPkgLevel()¶
Returns the conditions under which the error recovery package (configured via
SetErrorRecoveryPkgPath()) will be executedThis overrides settings from the parent element or from the test configuration.
- Returns:
-1 = disabled
0 = on abort only
1 = on ERROR and on abort
2 = on FAILED, ERROR and abort.
None: use inherited setting from parent element or test configuration
- Return type:
int
- GetErrorRecoveryPkgPath()¶
Returns the path of the error recovery Package to be executed upon abort of test execution or ERROR/FAILED, if this element has a custom setting which overrides inherited settings from the parent element or from the test configuration.
see also
GetErrorRecoveryPkgLevel()- Returns:
Absolute path to Package file; None if inherited or explicitly disabled
- Return type:
str
- GetFilename()¶
Returns the file name of the project file as absolute path, if this is a file. If not it may be unsaved.
- Returns:
The file name of the saved file or None, if not a file
- Return type:
str
-
GetFolders(skipDisabled=
True)¶ Returns all folders of the project.
- Parameters:
- skipDisabled : boolean¶
Defines whether disabled folders should be excluded.
- Returns:
Folders
- Return type:
list[
ProjectFolder]
- GetIndex()¶
Returns the zero based index in the parent.
- Returns:
Zero based index
- Return type:
int
- GetLineNo()¶
Returns the line number within its project.
- Returns:
Line number
- Return type:
int
- GetName()¶
Returns the name of the project component.
- Returns:
Name of the component
- Return type:
str
-
GetPackageCalls(skipDisabled=
True, noParameterSets=False)¶ Returns all package calls of the project. This method excludes stimulation package calls and analysis package calls.
- Parameters:
- Returns:
Package calls
- Return type:
list[
PackageCall]
-
GetPackageGenerators(skipDisabled=
True)¶ Returns all package generators of the project.
- Parameters:
- skipDisabled : boolean¶
Defines whether disabled generators should be excluded.
- Returns:
PackageGenerator
- Return type:
list[
PackageGenerator]
-
GetParameterGenerators(skipDisabled=
True)¶ Returns all parameter generators of the project.
- Parameters:
- skipDisabled : boolean¶
Defines whether disabled generators should be excluded.
- Returns:
ParameterGenerator
- Return type:
list[
ParameterGenerator]
-
GetParameterSets(skipDisabled=
True)¶ Returns all parameter sets of the project.
- Parameters:
- skipDisabled : boolean¶
Defines whether disabled parameter sets should be excluded.
- Returns:
Parameter records
- Return type:
list[
ParameterSet]
-
GetParameterVariationGenerators(skipDisabled=
True)¶ Returns all parameter generators of the project.
- Parameters:
- skipDisabled : boolean¶
Defines whether disabled generators should be excluded.
- Returns:
ParameterGenerator
- Return type:
- GetParent()¶
Returns the parent project component.
- Returns:
Parent component
- Return type:
-
GetProjectCalls(skipDisabled=
True)¶ Returns all project calls of the project.
- Parameters:
- skipDisabled : boolean¶
Defines whether disabled project calls should be excluded.
- Returns:
Project calls
- Return type:
list[
ProjectCall]
-
GetProjectGenerators(skipDisabled=
True)¶ Returns all project generators of the project.
- Parameters:
- skipDisabled : boolean¶
Defines whether disabled generators should be excluded.
- Returns:
ProjectGenerator
- Return type:
list[
ProjectGenerator]
- GetRandomExecutionOrderState()¶
Returns the random execution state of this container.
- Returns:
True if activated, False if deactivated or None if it is inherit from parent.
- Return type:
boolean
-
GetStimulationPackageCalls(skipDisabled=
True, noParameterSets=False)¶ Returns all stimulation package calls of the project.
- Parameters:
- Returns:
Package calls
- Return type:
list[
StimulationPackageCall]
- GetTestSuiteId()¶
Returns the test suite id of the project, if defined.
- Returns:
Test suite id
- Return type:
str
- GetType()¶
- Returns the type (class name) of the project component, e.g.
“ConfigChange”
“ParameterSet”
“PackageCall”
“Project”
“PackageGenerator”
- Returns:
Type (class name) of the project component
- Return type:
str
- HasComponents()¶
Returns whether the project has children.
- Returns:
True if there are children, False otherwise.
- Return type:
boolean
- HasCustomErrorRecoveryPackageSettings()¶
Returns whether the Package execution settings in case of test abort or ERROR/FAILED of the parent element are overridden
- Returns:
True if this element has custom error recovery package settings that override the parent element’s settings or those from the test configuration
- Return type:
boolean
- HasCustomRestoreSettings()¶
Returns if the value restore settings of the parent element are used or overridden by custom settings
- Returns:
True if custom settings used, False if parent settings used
- Return type:
boolean
- HasCustomRetrySettings()¶
Returns if the retry settings of the parent element are used
- Returns:
True if parent settings used, False if custom settings defined
- Return type:
boolean
- HasCustomSubprojectAbortSettings()¶
Returns if the subprojects abort settings of the parent element are used or overridden by custom settings
- Returns:
True if custom settings used, False if parent settings used
- Return type:
boolean
- HasCustomSubprojectExecutionSettings()¶
Returns if the subprojects execution settings of the parent element are used or overridden by custom settings
- Returns:
True if custom settings used, False if parent settings used
- Return type:
boolean
- InsertComponent(component, index)¶
Inserts a previously created component into the project at the given index.
- IsAbortOnSubprojectAbortActivated()¶
Returns if the abort of whole project on abort of subprojects is activated
- Returns:
True if activated, else False
- Return type:
boolean
- IsAbortOnSubprojectAbortDeactivated()¶
Returns if abort of whole project on abort of subprojects is deactivated
- Returns:
True if deactivated, else False
- Return type:
boolean
- IsAutomaticValueRestoreActivated()¶
Returns if the automatic value restore is activated
- Returns:
True if activated, else False
- Return type:
boolean
- IsAutomaticValueRestoreDeactivated()¶
Returns if the automatic value restore is deactivated
- Returns:
True if deactivated, 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
- IsIndependentSubprojectExecutionActivated()¶
Returns if the independent execution of subprojects is activated
- Returns:
True if activated, else False
- Return type:
boolean
- IsIndependentSubprojectExecutionDeactivated()¶
Returns if the independent execution of subprojects is deactivated
- Returns:
True if deactivated, else False
- Return type:
boolean
- IsReported()¶
Returns whether the test step will be reported. If it has a parent test step, this function will only return true if both this test step and the parent test step should be reported.
- Returns:
True if test step will be reported, otherwise False
- Return type:
bool
- RemoveComponent(component)¶
Removes a previously created component from the project.
- Parameters:
- component¶
The project component to be removed
- Raises:
ApiError: - When component is not of type “ProjectComponent” - When the component is not part of the project
-
Save(filename=
None, allowCompatibilityFallback=False)¶ Saves the project. Appends file ending if needed.
- Parameters:
- filename : str¶
File name of the project; Either absolute or relative to the ‘Packages’ directory. If left out, use the existing file name and path (from a previous call of
Save()orProjectApi.OpenProject())- allowCompatibilityFallback : bool¶
If True and a compatibility mode is active, save in the minimum compatible version when needed. If False, compatibility problems raise an exception instead.
- SaveAsArchive(filename)¶
Saves the project and it’s dependencies as archive. Appends file ending if needed.
- Parameters:
- filename : str¶
File name of the project archive; either absolute or relative to the ‘Packages’ directory.
- SetCustomRetryCondition(condition)¶
Sets the condition of the custom retry. Must be one of the following:
‘ERROR’
‘FAILED’
‘ERROR/FAILED’
- Parameters:
- condition : str¶
The condition of the custom retry
- SetCustomRetryCount(count)¶
Sets the number of the retries for all Packages within the project component.
- Parameters:
- count : integer¶
Number of the custom retries
- SetDescription(description)¶
Sets the description of the project.
- Parameters:
- description : str¶
description text
-
SetEnabled(state=
True)¶ Enable or disable the test step.
- Parameters:
- state : bool¶
True (=Default) to enable, False to disable the test step.
- SetErrorRecoveryPkgLevel(level)¶
Sets the conditions under which the error recovery package (configured via
SetErrorRecoveryPkgPath()) will be executedThis overrides settings from the parent element or from the test configuration.
- Parameters:
- level : int¶
- -1
disabled
0 on abort only
1 on ERROR and on abort
2 on FAILED, ERROR and abort.
- SetErrorRecoveryPkgPath(packagePath)¶
Sets the path for a Package to be executed upon abort of test execution or ERROR/FAILED.
This overrides settings from the parent element or from the test configuration.
See also
SetErrorRecoveryPkgLevel()- Parameters:
- packagePath : str¶
Absolute path to Package file
- SetRandomExecutionState(state)¶
Sets the random execution state of this container.
- Parameters:
- state : boolean¶
True to activate, False to deactivate or None for inheritance from parent.
-
SetReported(state=
True)¶ Enable or disable the reporting of the test step. If it has a parent test step, its reporting must also be enabled in order to have this test step appear in the report.
- Parameters:
- state : bool¶
True (=Default) to enable, False to disable the reporting of the test step.
- UseParentErrorRecoveryPackageSettings()¶
Sets that the Package execution settings in case of test abort or ERROR/FAILED of the parent element are used. Existing custom settings are deleted.
- UseParentRetrySettings()¶
Sets that the retry settings of the parent element are used. Existing custom settings are deleted.
- UseParentSubprojectAbortSettings()¶
Sets that the settings whether to cancel or end the whole project execution on abort of a separately executed subproject of the parent element are used. Existing custom settings are deleted.
- UseParentSubprojectExecutionSettings()¶
Sets that the settings whether to execute subprojects independently of the parent element are used. Existing custom settings are deleted.
- UseParentValueRestoreSettings()¶
Sets that the settings whether to restore the value of test quantities after the execution of every Package of the parent element are used. Existing custom settings are deleted.
- GetComponentByPosition(position)¶
Returns the component at a given position of the project
- Parameters:
- position : int¶
Position of component to be returned
- Returns:
Project component
- Return type:
Deprecated since version 2024.3: Please use method
GetComponentByLineNoinstead.