Table of Contents

Interface ITestSessionBuilder

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

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

bool

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

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.

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 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.

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.

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.

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.

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 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.