Instance Method


Waits on an array of expectations and specifies whether they must be fulfilled in the given order.


func wait(for expectations: [XCTestExpectation], timeout seconds: TimeInterval, enforceOrder enforceOrderOfFulfillment: Bool)



An array of expectations that must be fulfilled.


The number of seconds within which all expectations must be fulfilled.


If true, the expectations specified by the expectations parameter must be satisfied in the order they appear in the array.

See Also

Waiting for Expectations

func wait(for: [XCTestExpectation], timeout: TimeInterval)

Waits on a group of expectations for up to the specified timeout.

func waitForExpectations(timeout: TimeInterval, handler: XCWaitCompletionHandler?)

Waits until all expectations are fulfilled or the timeout is reached.

typealias XCWaitCompletionHandler

A block to be called when a call to waitForExpectations(timeout:handler:) has all of its expectations fulfilled, or times out.