Wait for the search field to be usable and remove unnecessary sleeps.

This commit is contained in:
Stefan Ceriu
2026-05-15 11:43:37 +03:00
parent 42b3507eaa
commit e8c7d0761f
+1 -9
View File
@@ -28,13 +28,9 @@ class UserFlowTests: XCTestCase {
/// Assumes app is on the home screen
private func checkRoomFlows() {
// Wait for the room list to paginate and correctly compute the room display names otherwise the test room
// won't be found
// Remove once https://github.com/element-hq/element-x-ios/issues/3365 gets sorted
sleep(30)
// Search for the special test room
let searchField = app.searchFields.firstMatch
XCTAssertTrue(searchField.waitForExistence(timeout: 30))
searchField.clearAndTypeText(Self.integrationTestsRoomName, app: app)
// And open it
@@ -68,8 +64,6 @@ class UserFlowTests: XCTestCase {
XCTAssertTrue(sendButton.waitForExistence(timeout: 10.0))
sendButton.tap(.center)
sleep(10) // Wait for the message to be sent
// Switch to the rich text editor
tapOnButton(A11yIdentifiers.roomScreen.composerToolbar.openComposeOptions)
tapOnButton(A11yIdentifiers.roomScreen.attachmentPickerTextFormatting)
@@ -82,8 +76,6 @@ class UserFlowTests: XCTestCase {
XCTAssertTrue(sendButton.waitForExistence(timeout: 10.0))
sendButton.tap(.center)
sleep(5) // Wait for the message to be sent
// Close the formatting options
app.buttons[A11yIdentifiers.roomScreen.composerToolbar.closeFormattingOptions].tap(.center)
}