Search Results for

    Show / Hide Table of Contents

    Class PageExtensions

    Defines a collection of extensions for page objects.

    Inheritance
    System.Object
    PageExtensions
    Namespace: Legerity.Extensions
    Assembly: Legerity.Core.dll
    Syntax
    public static class PageExtensions : object

    Methods

    | Improve this Doc View Source

    TryWaitUntil<TPage>(TPage, Func<TPage, Boolean>, Nullable<TimeSpan>, Int32, Action<Exception>)

    Attempts to wait until a specified page condition is met, with an optional timeout.

    Declaration
    public static (bool success, TPage page) TryWaitUntil<TPage>(this TPage page, Func<TPage, bool> condition, TimeSpan? timeout = null, int retries = 0, Action<Exception> exceptionHandler = null)
        where TPage : BasePage
    Parameters
    Type Name Description
    TPage page

    The page to wait on.

    Func<TPage, System.Boolean> condition

    The condition of the page to wait on.

    System.Nullable<TimeSpan> timeout

    The optional timeout wait on the condition being true.

    System.Int32 retries

    An optional count of retries after a timeout before accepting the failure.

    Action<Exception> exceptionHandler

    The optional exception handler thrown if an error occurs as a result of timeout.

    Returns
    Type Description
    System.ValueTuple<System.Boolean, TPage>

    Whether the wait was a success and the instance of the page.

    Type Parameters
    Name Description
    TPage

    The type of BasePage.

    | Improve this Doc View Source

    WaitUntil<TPage, TResult>(TPage, Func<TPage, TResult>, Nullable<TimeSpan>, Int32)

    Waits until a specified page condition is met, with an optional timeout.

    Declaration
    public static TPage WaitUntil<TPage, TResult>(this TPage page, Func<TPage, TResult> condition, TimeSpan? timeout = null, int retries = 0)
        where TPage : BasePage
    Parameters
    Type Name Description
    TPage page

    The page to wait on.

    Func<TPage, TResult> condition

    The condition of the page to wait on.

    System.Nullable<TimeSpan> timeout

    The optional timeout wait on the condition being true.

    System.Int32 retries

    An optional count of retries after a timeout before accepting the failure.

    Returns
    Type Description
    TPage

    The instance of the page.

    Type Parameters
    Name Description
    TPage

    The type of BasePage.

    TResult

    The type of expected result from the wait condition.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright (c) MADE Apps