Class TestSessionBuilder
TestSessionBuilder is a concrete implementation of the ITestSessionBuilder interface that is used to build test sessions.
public class TestSessionBuilder : ITestSessionBuilder
- Inheritance
-
TestSessionBuilder
- Implements
- Inherited Members
Properties
Component
Gets the test component associated with the testing context.
protected ITestComponent Component { get; }
Property Value
HasFailed
Gets a value indicating whether the test session has failed.
public bool HasFailed { get; }
Property Value
Instrumentation
Gets the instrumentation timer associated with the testing context.
protected IInstrumentation Instrumentation { get; }
Property Value
Steps
Gets a collection of test steps associated with the current instance of the test session builder.
public 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.
public 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.
public 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.
public 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.
public 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.
public 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.
public TestSession GetTestSession()
Returns
- TestSession
The test session.
Initiate(Uri, DateTime, TestContext)
Initializes the test session builder with the specified start time, the URL of the page being validated, and associating it with the current TestContext responsible for maintaining the state of the test execution.
public 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.