Skip to content

Commit e04e3ab

Browse files
authored
Merge pull request #2477 from nextcloud/fix/2459/open-conversation-test
fix: Open conversation test
2 parents 89033c7 + ca5bd08 commit e04e3ab

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

NextcloudTalkTests/UI/UIRoomTest.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,22 @@ final class UIRoomTest: XCTestCase {
6464
let app = launchAndLogin()
6565
let openConversationName = "OpenConversationTest"
6666

67+
// Check if the open conversation already exist in conversations list
68+
let conversationStaticText = app.tables.cells.staticTexts[openConversationName]
69+
let alreadyJoined = conversationStaticText.waitForExistence(timeout: 3.0)
70+
if alreadyJoined {
71+
// Try to leave the open conversation
72+
conversationStaticText.press(forDuration: 2.0)
73+
let leaveConversation = app.buttons["Leave conversation"]
74+
XCTAssert(conversationStaticText.waitForExistence(timeout: TestConstants.timeoutShort))
75+
76+
leaveConversation.tap()
77+
let alert = app.alerts.element.staticTexts["Leave conversation"]
78+
XCTAssert(alert.waitForExistence(timeout: TestConstants.timeoutShort))
79+
80+
app.buttons["Leave"].tap()
81+
}
82+
6783
waitForReady(object: app.buttons["Create or join a conversation"]).tap()
6884
waitForReady(object: app.tables.cells.staticTexts["Join open conversations"]).tap()
6985
waitForReady(object: app.tables.cells.staticTexts[openConversationName]).tap()

0 commit comments

Comments
 (0)