Class AppManager
Defines a manager for the application under test.
Inheritance
Namespace: Legerity
Assembly: Legerity.Core.dll
Syntax
public static class AppManager : object
Properties
| Improve this Doc View SourceAndroidApp
Gets the instance of the started Android application.
Declaration
public static AndroidDriver<AndroidElement> AndroidApp { get; }
Property Value
Type | Description |
---|---|
AndroidDriver<AndroidElement> |
Remarks
This instance should not be used in parallelized test runs. Instead, use the instance returned by the StartApp(AppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32) method.
App
Gets or sets the instance of the started application.
This could be a
Declaration
public static RemoteWebDriver App { get; set; }
Property Value
Type | Description |
---|---|
RemoteWebDriver |
Remarks
This instance should not be used in parallelized test runs. Instead, use the instance returned by the StartApp(AppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32) method.
Apps
Gets the instances of started applications.
Declaration
public static IReadOnlyCollection<RemoteWebDriver> Apps { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<RemoteWebDriver> |
IOSApp
Gets the instance of the started iOS application.
Declaration
public static IOSDriver<IOSElement> IOSApp { get; }
Property Value
Type | Description |
---|---|
IOSDriver<IOSElement> |
Remarks
This instance should not be used in parallelized test runs. Instead, use the instance returned by the StartApp(AppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32) method.
WebApp
Gets the instance of the started web application.
Declaration
public static RemoteWebDriver WebApp { 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(AppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32) method.
WindowsApp
Gets the instance of the started Windows application.
Declaration
public static WindowsDriver<WindowsElement> WindowsApp { get; }
Property Value
Type | Description |
---|---|
WindowsDriver<WindowsElement> |
Remarks
This instance should not be used in parallelized test runs. Instead, use the instance returned by the StartApp(AppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32) method.
Methods
| Improve this Doc View SourceStartApp(AppManagerOptions, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32)
Starts the application ready for testing.
Declaration
public static RemoteWebDriver StartApp(AppManagerOptions opts, Func<IWebDriver, bool> waitUntil = null, TimeSpan? waitUntilTimeout = null, int waitUntilRetries = 0)
Parameters
Type | Name | Description |
---|---|---|
AppManagerOptions | opts | The options to configure the driver with. |
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:
|
StopApp(RemoteWebDriver, Boolean)
Stops an application driver, with an option to stop the running Appium or WinAppDriver server.
Declaration
public static void StopApp(RemoteWebDriver app, bool stopServer = false)
Parameters
Type | Name | Description |
---|---|---|
RemoteWebDriver | app | The |
System.Boolean | stopServer | An optional value indicating whether to stop the running Appium or WinAppDriver server. Default, false. |
StopApp(Boolean)
Stops the App, with an option to stop the running Appium or WinAppDriver server.
Declaration
public static void StopApp(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. |
StopApps()
Stops all running application drivers.
Declaration
public static void StopApps()