diff --git a/sample-apps/swift-sample-app/swift-sample-app/swift-sample-app-ui-test/SwiftSampleAppUITest.swift b/sample-apps/swift-sample-app/swift-sample-app/swift-sample-app-ui-test/SwiftSampleAppUITest.swift index 7ee7ce3b9..6142456e0 100644 --- a/sample-apps/swift-sample-app/swift-sample-app/swift-sample-app-ui-test/SwiftSampleAppUITest.swift +++ b/sample-apps/swift-sample-app/swift-sample-app/swift-sample-app-ui-test/SwiftSampleAppUITest.swift @@ -10,6 +10,8 @@ import XCTest class SwiftSampleAppUITest: XCUITestBase { func testElementsVisible() { - XCTAssertTrue(app.staticTexts["Coffees"].exists) + if app.staticTexts["Coffees"].waitForExistence(timeout:10) { + XCTAssertTrue(app.staticTexts["Coffees"].exists) + } } }