OpenTAP 9.27
API Reference
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Events | List of all members
OpenTap.TestPlan Class Reference

Class containing a test plan. More...

Inheritance diagram for OpenTap.TestPlan:
OpenTap.ITestStepParent

Classes

class  PlanLoadException
 Exception occuring when a test plan loads. More...
 

Public Member Functions

 TestPlan ()
 
void FlushXmlCache ()
 Flushes the test plan XML cache.
 
byte[] GetCachedXml ()
 Get the cached XML (or null if it is not cached)
 
void Save (Stream stream, TapSerializer serializer)
 Saves this TestPlan to a stream with a specific serializer. More...
 
void Save (Stream stream)
 Saves this TestPlan to a stream; More...
 
void Save (string filePath)
 Saves this TestPlan to a file path. More...
 
TestPlan Reload (Stream filestream)
 Reload a TestPlan transferring the current execution state of the current plan to the new one. More...
 
TestPlanRun Execute ()
 Blocking Execute TestPlan. Uses ResultListeners from ResultSettings.Current. More...
 
Task< TestPlanRunExecuteAsync ()
 Executes the test plan asynchronously More...
 
Task< TestPlanRunExecuteAsync (CancellationToken abortToken)
 Executes the test plan asynchronously. More...
 
Task< TestPlanRunExecuteAsync (IEnumerable< IResultListener > resultListeners, IEnumerable< ResultParameter > metaDataParameters, HashSet< ITestStep > stepsOverride, CancellationToken cancellationToken)
 Execute the TestPlan as specified. More...
 
TestPlanRun Execute (IEnumerable< IResultListener > resultListeners, IEnumerable< ResultParameter > metaDataParameters=null, HashSet< ITestStep > stepsOverride=null)
 Execute the TestPlan as specified. Blocking. More...
 
TestPlanRun Execute (IEnumerable< IResultListener > resultListeners, IEnumerable< ResultParameter > metaDataParameters)
 Execute the TestPlan as specified. Blocking. More...
 
void Open ()
 Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources.
 
void Open (IEnumerable< IResultListener > listeners)
 Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources. More...
 
void Open (IEnumerable< IResource > additionalResources)
 Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources. It can also be called multiple times to add more resources. More...
 
void Open (IEnumerable< IResultListener > listeners, IEnumerable< IResource > additionalResources)
 Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources. It can also be called multiple times to add more resources. More...
 
void Close ()
 Closes all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This should be called if TestPlan.Open() was called earlier to manually close the resources again.
 

Static Public Member Functions

static TestPlan Load (string filePath)
 Load a TestPlan. More...
 
static TestPlan Load (string filePath, bool cacheXml)
 Load a TestPlan. More...
 
static TestPlan Load (Stream stream, string path)
 Load a TestPlan. More...
 
static TestPlan Load (Stream stream, string path, bool cacheXml, TapSerializer serializer=null)
 Load a TestPlan. More...
 
static List< string > GetPluginsRequiredToLoad (string filepath)
 Returns the list of plugins that are required to use the test plan. More...
 

Protected Member Functions

virtual void OnPropertyChanged (string name)
 When a property changes this function is called. More...
 

Properties

ExternalParameters ExternalParameters [get]
 Field for external test plan parameters.
 
TestStepList Steps [getset]
 A collection of TestStepBase steps.
 
TestStepList ChildTestSteps [get]
 List of test steps that make up this plan.

 
ITestStepParent Parent [getset]
 Always null for test plan.
 
ReadOnlyCollection< ITestStepEnabledSteps [get]
 Gets the subset of steps that are enabled.
 
string Name [get]
 Gets or sets the name. This is usually the name of the file where the test plan is saved, without the .TapPlan extension.
 
bool IsInBreak [get]
 True if the test plan is waiting in a break.
 
bool Locked [getset]
 Locks the TestPlan to signal that it should not be changed. The GUI respects this.
 
bool IsRunning [get]
 True if this TestPlan is currently running.
 
bool CacheXml [getset]
 Gets or sets if the test plan XML for this test plan should be cached.
 
string Path [get]
 Gets where this plan was last saved or loaded from. It might be null.
 
string? Directory [get]
 The directory where the test plan is stored.
 
bool PrintTestPlanRunSummary [getset]
 When true, prints the test plan run summary at the end of a run.
 
bool IsOpen [get]
 true if the plan is in its open state.
 
- Properties inherited from OpenTap.ITestStepParent
ITestStepParent Parent [getset]
 Parent TestStep for this TestStep. Null if this TestStep is not a child of any other TestSteps. Only guaranteed to be set during TestPlan.Execute().
 
TestStepList ChildTestSteps [get]
 Gets or sets a list of child TestSteps. (Inherited from ITestStepParent)
 

Events

EventHandler< BreakOfferedEventArgsBreakOffered
 A synchronous event that allows breaking the execution of the TestPlan by blocking the TestPlan execution thread. It is raised prior to executing the TestStep.Run method of each TestStep in the TestPlan. TestSteps may also raise this event from inside the TestStep.Run method.

 
PropertyChangedEventHandler PropertyChanged
 Event handler to on property changed.
 

Detailed Description

Class containing a test plan.

Member Function Documentation

◆ Execute() [1/3]

TestPlanRun OpenTap.TestPlan.Execute ( )
inline

Blocking Execute TestPlan. Uses ResultListeners from ResultSettings.Current.

Returns
Result of test plan run as a TestPlanRun object.

◆ Execute() [2/3]

TestPlanRun OpenTap.TestPlan.Execute ( IEnumerable< IResultListener resultListeners,
IEnumerable< ResultParameter metaDataParameters 
)
inline

Execute the TestPlan as specified. Blocking.

Parameters
resultListenersResultListeners for result outputs.
metaDataParametersMetadata parameters.
Returns
TestPlanRun results, no StepResults.

◆ Execute() [3/3]

TestPlanRun OpenTap.TestPlan.Execute ( IEnumerable< IResultListener resultListeners,
IEnumerable< ResultParameter metaDataParameters = null,
HashSet< ITestStep stepsOverride = null 
)
inline

Execute the TestPlan as specified. Blocking.

Parameters
resultListenersResultListeners for result outputs.
metaDataParametersOptional metadata parameters.
stepsOverrideSub-section of test plan to be executed. Note this might include child steps of disabled parent steps.
Returns
TestPlanRun results, no StepResults.

◆ ExecuteAsync() [1/3]

Task< TestPlanRun > OpenTap.TestPlan.ExecuteAsync ( )
inline

Executes the test plan asynchronously

Returns
A task returning the test plan run.

◆ ExecuteAsync() [2/3]

Task< TestPlanRun > OpenTap.TestPlan.ExecuteAsync ( CancellationToken  abortToken)
inline

Executes the test plan asynchronously.

Parameters
abortTokenThis abort token can be used to abort the operation.
Returns
A task returning the test plan run.

◆ ExecuteAsync() [3/3]

Task< TestPlanRun > OpenTap.TestPlan.ExecuteAsync ( IEnumerable< IResultListener resultListeners,
IEnumerable< ResultParameter metaDataParameters,
HashSet< ITestStep stepsOverride,
CancellationToken  cancellationToken 
)
inline

Execute the TestPlan as specified.

Parameters
resultListenersResultListeners for result outputs.
metaDataParametersOptional metadata parameters.
stepsOverrideSub-section of test plan to be executed. Note this might include child steps of disabled parent steps.
cancellationTokenCancellation token to abort the testplan
Returns
TestPlanRun results, no StepResults.

◆ GetPluginsRequiredToLoad()

static List< string > OpenTap.TestPlan.GetPluginsRequiredToLoad ( string  filepath)
inlinestatic

Returns the list of plugins that are required to use the test plan.

Parameters
filepath
Returns

◆ Load() [1/4]

static TestPlan OpenTap.TestPlan.Load ( Stream  stream,
string  path 
)
static

Load a TestPlan.

Parameters
streamThe stream from which the file is actually loaded.
pathThe path to the file. This will be tha value of TestPlan.Path on the new TestPlan.
Returns
Returns the new test plan.

◆ Load() [2/4]

static TestPlan OpenTap.TestPlan.Load ( Stream  stream,
string  path,
bool  cacheXml,
TapSerializer  serializer = null 
)
inlinestatic

Load a TestPlan.

Parameters
streamThe stream from which the file is actually loaded.
pathThe path to the file. This will be tha value of TestPlan.Path on the new TestPlan.
cacheXmlGets or sets if the XML should be cached.
serializerOptionally the serializer used for deserializing the test plan.
Returns
Returns the new test plan.

◆ Load() [3/4]

static TestPlan OpenTap.TestPlan.Load ( string  filePath)
static

Load a TestPlan.

Parameters
filePathThe file path of the TestPlan.
Returns
Returns the new test plan.

◆ Load() [4/4]

static TestPlan OpenTap.TestPlan.Load ( string  filePath,
bool  cacheXml 
)
inlinestatic

Load a TestPlan.

Parameters
filePathThe file path of the TestPlan.
cacheXmlGets or sets if the XML should be cached.
Returns
Returns the new test plan.

◆ OnPropertyChanged()

virtual void OpenTap.TestPlan.OnPropertyChanged ( string  name)
inlineprotectedvirtual

When a property changes this function is called.

Parameters
nameInputs the string for the property changed.

◆ Open() [1/3]

void OpenTap.TestPlan.Open ( IEnumerable< IResource additionalResources)
inline

Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources. It can also be called multiple times to add more resources.

Parameters
additionalResourcesAdditional resources added as 'static' resources.

◆ Open() [2/3]

void OpenTap.TestPlan.Open ( IEnumerable< IResultListener listeners)
inline

Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources.

Parameters
listenersResult listeners used in connection with the test plan.

◆ Open() [3/3]

void OpenTap.TestPlan.Open ( IEnumerable< IResultListener listeners,
IEnumerable< IResource additionalResources 
)
inline

Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources. It can also be called multiple times to add more resources.

Parameters
listenersResult listeners used in connection with the test plan.
additionalResourcesAdditional resources added as 'static' resources.

◆ Reload()

TestPlan OpenTap.TestPlan.Reload ( Stream  filestream)
inline

Reload a TestPlan transferring the current execution state of the current plan to the new one.

Parameters
filestreamThe filestream from which the plan loaded
Returns
Returns the new test plan.

◆ Save() [1/3]

void OpenTap.TestPlan.Save ( Stream  stream)

Saves this TestPlan to a stream;

Parameters
streamThe Stream in which to save the TestPlan.

◆ Save() [2/3]

void OpenTap.TestPlan.Save ( Stream  stream,
TapSerializer  serializer 
)
inline

Saves this TestPlan to a stream with a specific serializer.

Parameters
streamThe Stream in which to save the TestPlan.
serializerOptional. The serializer use for deserialization. If set to null, one will be created.

◆ Save() [3/3]

void OpenTap.TestPlan.Save ( string  filePath)
inline

Saves this TestPlan to a file path.

Parameters
filePathThe file path in which to save the TestPlan.

OpenTAP 9.27 API built Wed Nov 27 2024 13:14:46