Table of Contents

Class TestSessionBuilder

Namespace
Xping.Sdk.Core.Session
Assembly
Xping.Sdk.Core.dll

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

ITestComponent

HasFailed

Gets a value indicating whether the test session has failed.

public bool HasFailed { get; }

Property Value

bool

Instrumentation

Gets the instrumentation timer associated with the testing context.

protected IInstrumentation Instrumentation { get; }

Property Value

IInstrumentation

Steps

Gets a collection of test steps associated with the current instance of the test session builder.

public IReadOnlyCollection<TestStep> Steps { get; }

Property Value

IReadOnlyCollection<TestStep>

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 Exception

The 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 Error

The 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 PropertyBagKey

The property bag key that identifies the test session data.

value IPropertyBagValue

The 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 TestAgent

A test agent object wich declined test session.

error Error

The 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 Uri

The URL to be used for the test session.

startDate DateTime

The start date of the test session.

context TestContext

The context responsible for maintaining the state of the test execution.

Returns

ITestSessionBuilder

The initialized test session builder.