Class IOSElementWrapperExtensions
Defines a collection of extensions for IOSElementWrapper objects.
Inheritance
Namespace: Legerity.IOS.Extensions
Assembly: Legerity.IOS.dll
Syntax
public static class IOSElementWrapperExtensions : object
Methods
| Improve this Doc View SourceTryWaitUntil<TElementWrapper, TResult>(TElementWrapper, Func<TElementWrapper, TResult>, Nullable<TimeSpan>, Int32, Action<Exception>)
Attempts to wait until a specified element condition is met, with an optional timeout.
Declaration
public static bool TryWaitUntil<TElementWrapper, TResult>(this TElementWrapper element, Func<TElementWrapper, TResult> condition, TimeSpan? timeout = null, int retries = 0, Action<Exception> exceptionHandler = null)
where TElementWrapper : IOSElementWrapper
Parameters
Type | Name | Description |
---|---|---|
TElementWrapper | element | The element to wait on. |
Func<TElementWrapper, TResult> | condition | The condition of the element 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.Boolean | Whether the wait was a success. |
Type Parameters
Name | Description |
---|---|
TElementWrapper | The type of IOSElementWrapper. |
TResult | The type of expected result from the wait condition. |
WaitUntil<TElementWrapper, TResult>(TElementWrapper, Func<TElementWrapper, TResult>, Nullable<TimeSpan>, Int32)
Waits until a specified element condition is met, with an optional timeout.
Declaration
public static TResult WaitUntil<TElementWrapper, TResult>(this TElementWrapper element, Func<TElementWrapper, TResult> condition, TimeSpan? timeout = null, int retries = 0)
where TElementWrapper : IOSElementWrapper
Parameters
Type | Name | Description |
---|---|---|
TElementWrapper | element | The element to wait on. |
Func<TElementWrapper, TResult> | condition | The condition of the element 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 |
---|---|
TResult | The |
Type Parameters
Name | Description |
---|---|
TElementWrapper | The type of IOSElementWrapper. |
TResult | The type of expected result from the wait condition. |