File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff 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 ( )
You can’t perform that action at this time.
0 commit comments