ScreenExpect
Namespace: E2E
public sealed class ScreenExpectMatchers on the whole screen: String).
Inheritance: object
Properties
Section titled “Properties”public ScreenExpect Not { get; }Inverts the matcher: waits for the screen to differ from its stored screenshot.
Value: ScreenExpect
Methods
Section titled “Methods”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
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