Expect
Namespace: E2E
public static class ExpectPolling assertions for a Locator, expect.soft, and
expect.poll. A passing locator assertion verifies the previous
agent.act. Plain value matchers are not ported: use NUnit
Assert.That, and Assert.EnterMultipleScope for soft value checks.
Inheritance: object
Methods
Section titled “Methods”Poll<T>(Func<CancellationToken, Task<T>>, PollOptions?)
Section titled “Poll<T>(Func<CancellationToken, Task<T>>, PollOptions?)”public static PollExpectation<T> Poll<T>(Func<CancellationToken, Task<T>> read, PollOptions? options = null)Re-reads <code class=“paramref”>read</code> until the chosen matcher holds or the timeout passes.
Type parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
read |
Func<CancellationToken, Task<T>> | |
options |
PollOptions |
Returns: PollExpectation<T>
Poll<T>(Func<Task<T>>, PollOptions?)
Section titled “Poll<T>(Func<Task<T>>, PollOptions?)”public static PollExpectation<T> Poll<T>(Func<Task<T>> read, PollOptions? options = null)Re-reads <code class=“paramref”>read</code> until the chosen matcher holds or the timeout passes.
Type parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
read |
Func<Task<T>> | |
options |
PollOptions |
Returns: PollExpectation<T>
Poll<T>(Func<T>, PollOptions?)
Section titled “Poll<T>(Func<T>, PollOptions?)”public static PollExpectation<T> Poll<T>(Func<T> read, PollOptions? options = null)Re-reads <code class=“paramref”>read</code> until the chosen matcher holds or the timeout passes.
Type parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
read |
Func<T> | |
options |
PollOptions |
Returns: PollExpectation<T>
Soft(Browser)
Section titled “Soft(Browser)”public static SoftBrowserExpect Soft(Browser browser)The browser matchers, but a failure is kept as Soft(Locator) keeps one.
Parameters
| Name | Type | Description |
|---|---|---|
browser |
Browser |
Returns: SoftBrowserExpect
Soft(Locator)
Section titled “Soft(Locator)”public static SoftLocatorExpect Soft(Locator locator)The locator matchers, but a failure is kept on the session instead of
thrown and the body runs on. The test fails at the end with every kept
failure. E2ETest records each one as an NUnit assertion failure.
Parameters
| Name | Type | Description |
|---|---|---|
locator |
Locator |
Returns: SoftLocatorExpect
That(Browser)
Section titled “That(Browser)”public static BrowserExpect That(Browser browser)Waits for the browser’s URL or title with BrowserExpect. A passing matcher verifies the previous act.
Parameters
| Name | Type | Description |
|---|---|---|
browser |
Browser |
Returns: BrowserExpect
That(Locator)
Section titled “That(Locator)”public static LocatorExpect That(Locator locator)Parameters
| Name | Type | Description |
|---|---|---|
locator |
Locator |
Returns: LocatorExpect
That(Screen)
Section titled “That(Screen)”public static ScreenExpect That(Screen screen)Compares the whole screen against a stored screenshot with String).
Parameters
| Name | Type | Description |
|---|---|---|
screen |
Screen |
Returns: ScreenExpect