From 3023212e3bd1d9452b597b076cc74a5addd3fbce Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Mon, 27 Apr 2026 19:41:27 +0200 Subject: [PATCH] fix for the flaky start chat test flow --- UITests/Sources/StartChatTests.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/UITests/Sources/StartChatTests.swift b/UITests/Sources/StartChatTests.swift index be99a6d12..a4aaf6a0b 100644 --- a/UITests/Sources/StartChatTests.swift +++ b/UITests/Sources/StartChatTests.swift @@ -59,8 +59,14 @@ class StartChatTests: XCTestCase { let inviteUsersSearchField = app.searchFields.firstMatch inviteUsersSearchField.clearAndTypeText("Bob\n", app: app) + let cells = app.collectionViews.firstMatch.cells - XCTAssertEqual(cells.count, 2) + // The update of the cells is not immediate, and may take a bunch of milliseconds + // so let's await it. + let predicate = NSPredicate(format: "count == 2") + let expectation = XCTNSPredicateExpectation(predicate: predicate, object: cells) + await fulfillment(of: [expectation], timeout: 5.0) + try await app.assertScreenshot(step: Step.inviteUsersWithResults) cells.element(boundBy: 0).tap()