Search Results for

    Show / Hide Table of Contents

    Class LegerityTestClass

    Defines a base class for running tests with the Legerity framework.

    Inheritance
    System.Object
    LegerityTestClass
    Namespace: Legerity
    Assembly: Legerity.Core.dll
    Syntax
    public abstract class LegerityTestClass : object

    Constructors

    | Improve this Doc View Source

    LegerityTestClass()

    Initializes a new instance of the LegerityTestClass class.

    The Options will need to be set before calling StartApp(Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32).

    Declaration
    protected LegerityTestClass()
    | Improve this Doc View Source

    LegerityTestClass(AppManagerOptions)

    Initializes a new instance of the LegerityTestClass class with application launch option.

    Declaration
    protected LegerityTestClass(AppManagerOptions options)
    Parameters
    Type Name Description
    AppManagerOptions options

    The application launch options.

    Properties

    | Improve this Doc View Source

    App

    Gets the instance of the started application.

    This could be a , , , or web driver.

    Declaration
    protected RemoteWebDriver App { get; }
    Property Value
    Type Description
    RemoteWebDriver
    Remarks

    This instance should not be used in parallelized test runs. Instead, use the instance returned by the StartApp(Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32) or StartApp(AppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32) method.

    | Improve this Doc View Source

    Apps

    Gets or sets the instances of started applications.

    Declaration
    protected IReadOnlyCollection<RemoteWebDriver> Apps { get; }
    Property Value
    Type Description
    IReadOnlyCollection<RemoteWebDriver>
    Remarks

    This is useful for accessing drivers in parallelized tests.

    | Improve this Doc View Source

    Options

    Gets or sets the model that represents the configuration options for the AppManager.

    Declaration
    protected AppManagerOptions Options { get; set; }
    Property Value
    Type Description
    AppManagerOptions

    Methods

    | Improve this Doc View Source

    StartApp(Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32)

    Starts the application ready for testing.

    Declaration
    public virtual RemoteWebDriver StartApp(Func<IWebDriver, bool> waitUntil = null, TimeSpan? waitUntilTimeout = null, int waitUntilRetries = 0)
    Parameters
    Type Name Description
    Func<IWebDriver, System.Boolean> waitUntil

    An optional condition of the driver to wait on until it is met.

    System.Nullable<TimeSpan> waitUntilTimeout

    An optional timeout wait on the conditional wait until being true. If not set, the wait will run immediately, and if not valid, will throw an exception.

    System.Int32 waitUntilRetries

    An optional count of retries after a timeout on the wait until condition before accepting the failure.

    Returns
    Type Description
    RemoteWebDriver

    The configured and running application driver.

    Exceptions
    Type Condition
    DriverLoadFailedException

    Thrown when the application is null, the session ID is null once initialized, or the driver fails to configure correctly before returning.

    LegerityException

    Thrown when:

    • The Appium server could not be found when running with LaunchAppiumServer or LaunchAppiumServer true.
    • The WinAppDriver could not be found when running with LaunchWinAppDriver true.
    • The WinAppDriver failed to load when running with LaunchWinAppDriver true.
    | Improve this Doc View Source

    StartApp(AppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32)

    Starts the application ready for testing.

    Declaration
    public virtual RemoteWebDriver StartApp(AppManagerOptions options, Func<IWebDriver, bool> waitUntil = null, TimeSpan? waitUntilTimeout = null, int waitUntilRetries = 0)
    Parameters
    Type Name Description
    AppManagerOptions options

    The optional options to configure the driver with.

    Settings this will override the Options if previously set.

    Func<IWebDriver, System.Boolean> waitUntil

    An optional condition of the driver to wait on until it is met.

    System.Nullable<TimeSpan> waitUntilTimeout

    An optional timeout wait on the conditional wait until being true. If not set, the wait will run immediately, and if not valid, will throw an exception.

    System.Int32 waitUntilRetries

    An optional count of retries after a timeout on the wait until condition before accepting the failure.

    Returns
    Type Description
    RemoteWebDriver

    The configured and running application driver.

    Exceptions
    Type Condition
    DriverLoadFailedException

    Thrown when the application is null, the session ID is null once initialized, or the driver fails to configure correctly before returning.

    LegerityException

    Thrown when:

    • The Appium server could not be found when running with LaunchAppiumServer or LaunchAppiumServer true.
    • The WinAppDriver could not be found when running with LaunchWinAppDriver true.
    • The WinAppDriver failed to load when running with LaunchWinAppDriver true.
    | Improve this Doc View Source

    StopApp()

    Stops the App and any running Appium or WinAppDriver server.

    Declaration
    public virtual void StopApp()
    | Improve this Doc View Source

    StopApp(RemoteWebDriver, Boolean)

    Stops an application, with an option to stop the running Appium or WinAppDriver server.

    Declaration
    public virtual void StopApp(RemoteWebDriver app, bool stopServer = false)
    Parameters
    Type Name Description
    RemoteWebDriver app

    The instance to stop running.

    System.Boolean stopServer

    An optional value indicating whether to stop the running Appium or WinAppDriver server. Default, false.

    | Improve this Doc View Source

    StopApp(Boolean)

    Stops the App, with an option to stop the running Appium or WinAppDriver server.

    Declaration
    public virtual void StopApp(bool stopServer)
    Parameters
    Type Name Description
    System.Boolean stopServer

    An optional value indicating whether to stop the running Appium or WinAppDriver server.

    | Improve this Doc View Source

    StopApps(Boolean)

    Stops all running application drivers, with an option to stop the running Appium or WinAppDriver server.

    Declaration
    public virtual void StopApps(bool stopServer = true)
    Parameters
    Type Name Description
    System.Boolean stopServer

    An optional value indicating whether to stop the running Appium or WinAppDriver server. Default, true.

    Extension Methods

    LegerityTestClassExtensions.StartAndroidApp(LegerityTestClass, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32)
    LegerityTestClassExtensions.StartAndroidApp(LegerityTestClass, AndroidAppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32)
    LegerityTestClassExtensions.StartIOSApp(LegerityTestClass, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32)
    LegerityTestClassExtensions.StartIOSApp(LegerityTestClass, IOSAppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32)
    LegerityTestClassExtensions.StartWindowsApp(LegerityTestClass, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32)
    LegerityTestClassExtensions.StartWindowsApp(LegerityTestClass, WindowsAppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright (c) MADE Apps