OpenTAP 9.24
API Reference
Static Public Member Functions | List of all members
OpenTap.TestStepExtensions Class Reference

An extension class for the ITestStep interface. More...

Static Public Member Functions

static T GetParent< T > (this ITestStep step)
 Searches up through the Parent steps and returns the first step of the requested type that it finds.
More...
 
static T GetParent< T > (this ITestStepParent item)
 Searches up through the Parent steps and returns the first step of the requested type that it finds.
More...
 
static void OfferBreak (this ITestStep Step, bool isTestStepStarting=false)
 Raises the TestPlan.BreakOffered event on the TestPlan object to which this TestStep belongs. More...
 
static void OfferBreak (this ITestStep Step, TestStepRun stepRun, bool isTestStepStarting=false)
 Raises the TestPlan.BreakOffered event on the TestPlan object to which this TestStep belongs. More...
 
static IEnumerable< ITestStepGetEnabledChildSteps (this ITestStep Step)
 Gets all the enabled Child Steps.
 
static IEnumerable< ITestStepGetChildSteps (this ITestStep Step, TestStepSearch searchKind)
 Gets children following a specific search patterns. Not recursive. More...
 
static IEnumerable< ITestStepRecursivelyGetChildSteps (this ITestStep Step, TestStepSearch searchKind)
 Recursively collects a complete list of child steps using the specified pattern. Order is depth-first.
More...
 
static IEnumerable< TestStepRunRunChildSteps (this ITestStep step, TestPlanRun currentPlanRun, TestStepRun currentStepRun, IEnumerable< ResultParameter > attachedParameters=null)
 Runs all enabled TestStep.ChildTestSteps of this TestStep. Upgrades parent verdict to the resulting verdict of the childrens run. Throws an exception if the child step does not belong or isn't enabled. More...
 
static IEnumerable< TestStepRunRunChildSteps (this ITestStep step, TestPlanRun currentPlanRun, TestStepRun currentStepRun, IEnumerable< ResultParameter > attachedParameters, CancellationToken cancellationToken)
 Runs all enabled TestStep.ChildTestSteps of this TestStep. Upgrades parent verdict to the resulting verdict of the childrens run. Throws an exception if the child step does not belong or isn't enabled. More...
 
static IEnumerable< TestStepRunRunChildSteps (this ITestStep step, TestPlanRun currentPlanRun, TestStepRun currentStepRun, IEnumerable< ResultParameter > attachedParameters, CancellationToken cancellationToken, bool throwOnBreak)
 Runs all enabled TestStep.ChildTestSteps of this TestStep. Upgrades parent verdict to the resulting verdict of the childrens run. Throws an exception if the child step does not belong or isn't enabled. More...
 
static TestStepRun RunChildStep (this ITestStep step, ITestStep childStep, TestPlanRun currentPlanRun, TestStepRun currentStepRun, IEnumerable< ResultParameter > attachedParameters=null)
 Runs the specified child step if enabled. Upgrades parent verdict to the resulting verdict of the child run. Throws an exception if childStep does not belong or isn't enabled. More...
 
static TestStepRun RunChildStep (this ITestStep step, ITestStep childStep, bool throwOnBreak, TestPlanRun currentPlanRun, TestStepRun currentStepRun, IEnumerable< ResultParameter > attachedParameters=null)
 Runs the specified child step if enabled. Upgrades parent verdict to the resulting verdict of the child run. Throws an exception if childStep does not belong or isn't enabled. More...
 
static string GetFormattedName (this ITestStep step)
 Takes the name of step and replaces {} tokens with the value of properties.
 

Detailed Description

An extension class for the ITestStep interface.

Member Function Documentation

◆ GetChildSteps()

static IEnumerable< ITestStep > OpenTap.TestStepExtensions.GetChildSteps ( this ITestStep  Step,
TestStepSearch  searchKind 
)
inlinestatic

Gets children following a specific search patterns. Not recursive.

Parameters
Step
searchKindSearch pattern to use.
Returns
Unevaluated IEnumerable.

◆ GetParent&lt; T &gt;() [1/2]

static T OpenTap.TestStepExtensions.GetParent< T > ( this ITestStep  step)
static

Searches up through the Parent steps and returns the first step of the requested type that it finds.

Template Parameters
TThe type of TestStep to get.
Returns
The closest TestStep of the requested type in the hierarchy.

◆ GetParent&lt; T &gt;() [2/2]

static T OpenTap.TestStepExtensions.GetParent< T > ( this ITestStepParent  item)
inlinestatic

Searches up through the Parent steps and returns the first step of the requested type that it finds.

Template Parameters
TThe type of TestStep to get.
Returns
The closest TestStep of the requested type in the hierarchy.

◆ OfferBreak() [1/2]

static void OpenTap.TestStepExtensions.OfferBreak ( this ITestStep  Step,
bool  isTestStepStarting = false 
)
inlinestatic

Raises the TestPlan.BreakOffered event on the TestPlan object to which this TestStep belongs.

This method allows a user interface implementation to break/pause the execution of the TestPlan at the point at which it is called.

◆ OfferBreak() [2/2]

static void OpenTap.TestStepExtensions.OfferBreak ( this ITestStep  Step,
TestStepRun  stepRun,
bool  isTestStepStarting = false 
)
inlinestatic

Raises the TestPlan.BreakOffered event on the TestPlan object to which this TestStep belongs.

This method allows a user interface implementation to break/pause the execution of the TestPlan at the point at which it is called.

◆ RecursivelyGetChildSteps()

static IEnumerable< ITestStep > OpenTap.TestStepExtensions.RecursivelyGetChildSteps ( this ITestStep  Step,
TestStepSearch  searchKind 
)
inlinestatic

Recursively collects a complete list of child steps using the specified pattern. Order is depth-first.

Parameters
Step
searchKindPattern.
Returns
Unevaluated IEnumerable of test steps.

◆ RunChildStep() [1/2]

static TestStepRun OpenTap.TestStepExtensions.RunChildStep ( this ITestStep  step,
ITestStep  childStep,
bool  throwOnBreak,
TestPlanRun  currentPlanRun,
TestStepRun  currentStepRun,
IEnumerable< ResultParameter attachedParameters = null 
)
inlinestatic

Runs the specified child step if enabled. Upgrades parent verdict to the resulting verdict of the child run. Throws an exception if childStep does not belong or isn't enabled.

Parameters
step
childStepThe child step to run.
throwOnBreakWhether an exception will be thrown due to break conditions or if they will be caught. Exceptions are still available on child test steps TestStepRun.Exception.
currentPlanRunThe current TestPlanRun.
currentStepRunThe current TestStepRun.
attachedParametersParameters that will be stored together with the actual parameters of the step.

◆ RunChildStep() [2/2]

static TestStepRun OpenTap.TestStepExtensions.RunChildStep ( this ITestStep  step,
ITestStep  childStep,
TestPlanRun  currentPlanRun,
TestStepRun  currentStepRun,
IEnumerable< ResultParameter attachedParameters = null 
)
inlinestatic

Runs the specified child step if enabled. Upgrades parent verdict to the resulting verdict of the child run. Throws an exception if childStep does not belong or isn't enabled.

Parameters
step
childStepThe child step to run.
currentPlanRunThe current TestPlanRun.
currentStepRunThe current TestStepRun.
attachedParametersParameters that will be stored together with the actual parameters of the step.

◆ RunChildSteps() [1/3]

static IEnumerable< TestStepRun > OpenTap.TestStepExtensions.RunChildSteps ( this ITestStep  step,
TestPlanRun  currentPlanRun,
TestStepRun  currentStepRun,
IEnumerable< ResultParameter attachedParameters,
CancellationToken  cancellationToken 
)
inlinestatic

Runs all enabled TestStep.ChildTestSteps of this TestStep. Upgrades parent verdict to the resulting verdict of the childrens run. Throws an exception if the child step does not belong or isn't enabled.

Parameters
step
currentPlanRunThe current TestPlanRun.
currentStepRunThe current TestStepRun.
attachedParametersParameters that will be stored together with the actual parameters of the steps.
cancellationTokenProvides a way to cancel the execution of child steps before all steps are executed.

◆ RunChildSteps() [2/3]

static IEnumerable< TestStepRun > OpenTap.TestStepExtensions.RunChildSteps ( this ITestStep  step,
TestPlanRun  currentPlanRun,
TestStepRun  currentStepRun,
IEnumerable< ResultParameter attachedParameters,
CancellationToken  cancellationToken,
bool  throwOnBreak 
)
inlinestatic

Runs all enabled TestStep.ChildTestSteps of this TestStep. Upgrades parent verdict to the resulting verdict of the childrens run. Throws an exception if the child step does not belong or isn't enabled.

Parameters
step
currentPlanRunThe current TestPlanRun.
currentStepRunThe current TestStepRun.
attachedParametersParameters that will be stored together with the actual parameters of the steps.
cancellationTokenProvides a way to cancel the execution of child steps before all steps are executed.
throwOnBreakWhether an exception will be thrown due to break conditions or if they will be caught. Exceptions are still available on child test steps TestStepRun.Exception.

◆ RunChildSteps() [3/3]

static IEnumerable< TestStepRun > OpenTap.TestStepExtensions.RunChildSteps ( this ITestStep  step,
TestPlanRun  currentPlanRun,
TestStepRun  currentStepRun,
IEnumerable< ResultParameter attachedParameters = null 
)
inlinestatic

Runs all enabled TestStep.ChildTestSteps of this TestStep. Upgrades parent verdict to the resulting verdict of the childrens run. Throws an exception if the child step does not belong or isn't enabled.

Parameters
step
currentPlanRunThe current TestPlanRun.
currentStepRunThe current TestStepRun.
attachedParametersParameters that will be stored together with the actual parameters of the steps.

OpenTAP 9.24 API built Tue Apr 30 2024 13:44:42