a view hierarchy thanks to Swift Re f lection API • Search the view of a speci f ic type or condition • Read the inner state of the standard views • Works with runtime properties (@EnvironmentObject, @State) • Trigger side effects
your UI does not have unexpected changes (i.e. regressions). • We compare the output of a test to a previous test run’s output, called the baseline snapshot. • Are perfect for verifying behavior that changes frequently and is not clearly de f ined (iOS versions changes)
(XCUIElement) - > Bool, timeout: UITestTimeout = .standard, message: @autoclosure () - > String = "", f i le: StaticString = #f i le, line: UInt = #line ) - > Self { if expression(self) { return self } let predicate = NSPredicate { _, _ in expression(self) } let expectation = XCTNSPredicateExpectation(predicate: predicate, object: nil) let result = XCTWaiter().wait(for: [expectation], timeout: timeout.rawValue) if result ! = .completed { XCTFail(message().isEmpty ? "expectation not matched after waiting" : message(), f i le: f i le, line: line ) } return self } https://sourcediving.com/clean-waiting-in-xcuitest-43bab495230f