Skip to content

App

Namespace: E2E

public sealed class App

Opens and resets the app under test. A relative URL is resolved against BaseUrl; no URL opens the base URL.

Inheritance: object

View source

public string? BaseUrl { get; }

The target base URL relative URLs resolve against, or null when the test declares none.

Value: string

View source

public Task BackAsync(CancellationToken cancellationToken = default)

Goes back one entry in the history. With no earlier entry it does nothing.

Parameters

Name Type Description
cancellationToken CancellationToken

Returns: Task

View source

public Task ClearStateAsync(CancellationToken cancellationToken = default)

Discards cookies, storage, and history, and reopens the app at BaseUrl.

Parameters

Name Type Description
cancellationToken CancellationToken

Returns: Task

View source

public Task OpenAsync(string? url = null, CancellationToken cancellationToken = default)

Opens a path or URL, resolved against the base URL. No URL opens the base URL itself. Throws APP_URL_REQUIRED for a relative URL when the test declares no base URL, and POLICY_DENIED for a malformed URL or a scheme other than http: or https: (the exact about:blank is admitted).

Parameters

Name Type Description
url string
cancellationToken CancellationToken

Returns: Task

View source

public Task RestartAsync(CancellationToken cancellationToken = default)

Closes the current document and reopens the app at BaseUrl. Cookies and storage are kept.

Parameters

Name Type Description
cancellationToken CancellationToken

Returns: Task

View source