Interface ITestSessionBuilder
The ITestSessionBuilder interface is used to build test sessions. It provides methods to initialize the test session builder with the specified URL and start date, get a value indicating whether the test session has failed, get the property bag that stores key-value pairs of items that can be referenced later in the pipeline, and build a test step with the specified component, instrumentation log, and error or exception.
public interface ITestSessionBuilder
Properties
HasFailed
Gets a value indicating whether the test session has failed.
bool HasFailed { get; }
Property Value
Steps
Gets a read only collection of test steps associated with the current instance of the test session builder.
IReadOnlyCollection<TestStep> Steps { get; }
Property Value
Methods
Build()
Constructs a successful TestStep instance, integrating it with the corresponding test component. This instance is also synchronized with the instrumentation timer managed by the TestContext, ensuring accurate tracking of execution metrics.
TestStep Build()
Returns
- TestStep
The built test step.
Build(Exception)
Constructs a failed TestStep instance, integrating it with the corresponding test component. This instance is also synchronized with the instrumentation timer managed by the TestContext, ensuring accurate tracking of execution metrics.
TestStep Build(Exception exception)
Parameters
exception
ExceptionThe exception to be used for the failed test step.
Returns
- TestStep
The built test step.
Build(Error)
Constructs a failed TestStep instance, integrating it with the corresponding test component. This instance is also synchronized with the instrumentation timer managed by the TestContext, ensuring accurate tracking of execution metrics.
TestStep Build(Error error)
Parameters
error
ErrorThe error to be used for the failed test step.
Returns
- TestStep
The built test step.
Build(PropertyBagKey, IPropertyBagValue)
Builds a test session property bag with the speicified PropertyBagKey and ISerializable derived type as a property bag value.
ITestSessionBuilder Build(PropertyBagKey key, IPropertyBagValue value)
Parameters
key
PropertyBagKeyThe property bag key that identifies the test session data.
value
IPropertyBagValueThe property bag value that contains the test session data.
Returns
- ITestSessionBuilder
An instance of the current ITestSessionBuilder that can be used to build the test session.
Build(TestAgent, Error)
Builds a test session that has been declined by the TestAgent.
void Build(TestAgent agent, Error error)
Parameters
agent
TestAgentA test agent object wich declined test session.
error
ErrorThe error to be used for the test session as decline reason.
GetTestSession()
Gets the test session.
TestSession GetTestSession()
Returns
- TestSession
The test session.
Initiate(Uri, DateTime, TestContext)
Initializes the test session builder with the specified URL, start date and TestContext object.
ITestSessionBuilder Initiate(Uri url, DateTime startDate, TestContext context)
Parameters
url
UriThe URL to be used for the test session.
startDate
DateTimeThe start date of the test session.
context
TestContextThe context responsible for maintaining the state of the test execution.
Returns
- ITestSessionBuilder
The initialized test session builder.