From 87c7859b6a83fa31ba777c846177df0df4a957a0 Mon Sep 17 00:00:00 2001 From: Ivan Sein Date: Tue, 19 Mar 2024 12:07:43 +0100 Subject: [PATCH] Wait for existence of some elements in create conversation test. Signed-off-by: Ivan Sein --- NextcloudTalkTests/UI/UIRoomTest.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/NextcloudTalkTests/UI/UIRoomTest.swift b/NextcloudTalkTests/UI/UIRoomTest.swift index 0363d61e4..28df6e22f 100644 --- a/NextcloudTalkTests/UI/UIRoomTest.swift +++ b/NextcloudTalkTests/UI/UIRoomTest.swift @@ -30,9 +30,15 @@ final class UIRoomTest: XCTestCase { func createConversation(for app: XCUIApplication, with newConversationName: String) { app.navigationBars["Nextcloud Talk"].buttons["Create or join a conversation"].tap() - app.buttons["Create a new conversation"].tap() + + let createNewConversationButton = app.buttons["Create a new conversation"] + XCTAssert(createNewConversationButton.waitForExistence(timeout: TestConstants.timeoutShort)) + createNewConversationButton.tap() + + let newConversationNavBar = app.navigationBars["New conversation"] + XCTAssert(newConversationNavBar.waitForExistence(timeout: TestConstants.timeoutShort)) app.typeText(newConversationName) - app.navigationBars["New conversation"].buttons["Create"].tap() + newConversationNavBar.buttons["Create"].tap() } func testCreateConversation() {