wait(for:toEqual:timeout:)
Waits a specified amount of time for a property value to equal a specified value.
Declaration
@MainActor @preconcurrency func wait<V>(for keyPath: KeyPath<XCUIElement, V>, toEqual expectedValue: V, timeout: TimeInterval) -> Bool where V : EquatableParameters
- keyPath:
The observed property on an Xcuielement.
- expectedValue:
The desired value, which must conform to
Equatable. - timeout:
The length of time in seconds to wait for the observed property to equal the expected value.
Discussion
This method returns false if the timeout expires before the observed property equals the expected value.