Skip to content

ScreenExpect

Namespace: E2E

public sealed class ScreenExpect

Matchers on the whole screen: String).

Inheritance: object

View source

public ScreenExpect Not { get; }

Inverts the matcher: waits for the screen to differ from its stored screenshot.

Value: ScreenExpect

View source

ToHaveScreenshotAsync(ScreenshotOptions, string?)

Section titled “ToHaveScreenshotAsync(ScreenshotOptions, string?)”
public Task ToHaveScreenshotAsync(ScreenshotOptions options, string? callerFile = null)

Waits for the screen to look like its stored screenshot, <test file>-snapshots/<name>-<target>-<os>.png beside the file this call is in. <code class=“paramref”>name</code> defaults to the test’s title and a count. A missing screenshot is written and fails the call, or, with E2E_UPDATE_SNAPSHOTS=1, written and passed. Only the web engine captures pixels.

Parameters

Name Type Description
options ScreenshotOptions
callerFile string

Returns: Task

View source

ToHaveScreenshotAsync(string?, ScreenshotOptions?, string?)

Section titled “ToHaveScreenshotAsync(string?, ScreenshotOptions?, string?)”
public Task ToHaveScreenshotAsync(string? name = null, ScreenshotOptions? options = null, string? callerFile = null)

Waits for the screen to look like its stored screenshot, <test file>-snapshots/<name>-<target>-<os>.png beside the file this call is in. <code class=“paramref”>name</code> defaults to the test’s title and a count. A missing screenshot is written and fails the call, or, with E2E_UPDATE_SNAPSHOTS=1, written and passed. Only the web engine captures pixels.

Parameters

Name Type Description
name string
options ScreenshotOptions
callerFile string

Returns: Task

View source