@@ -124,7 +124,8 @@ Cypress.Commands.add("startDM", (name: string) => {
124124 cy . get ( ".mx_BasicMessageComposer_input" )
125125 . should ( "have.focus" )
126126 . type ( "Hey!{enter}" ) ;
127- cy . contains ( ".mx_EventTile_body" , "Hey!" ) ;
127+ // The DM room is created at this point, this can take a little bit of time
128+ cy . contains ( ".mx_EventTile_body" , "Hey!" , { timeout : 30000 } ) ;
128129 cy . contains ( ".mx_RoomSublist[aria-label=People]" , name ) ;
129130} ) ;
130131
@@ -217,7 +218,7 @@ describe("Spotlight", () => {
217218 it ( "should find joined rooms" , ( ) => {
218219 cy . openSpotlightDialog ( ) . within ( ( ) => {
219220 cy . spotlightSearch ( ) . clear ( ) . type ( room1Name ) ;
220- cy . wait ( 1000 ) ; // wait for the dialog code to settle
221+ cy . wait ( 3000 ) ; // wait for the dialog code to settle
221222 cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
222223 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , room1Name ) ;
223224 cy . spotlightResults ( ) . eq ( 0 ) . click ( ) ;
@@ -231,7 +232,7 @@ describe("Spotlight", () => {
231232 cy . openSpotlightDialog ( ) . within ( ( ) => {
232233 cy . spotlightFilter ( Filter . PublicRooms ) ;
233234 cy . spotlightSearch ( ) . clear ( ) . type ( room1Name ) ;
234- cy . wait ( 1000 ) ; // wait for the dialog code to settle
235+ cy . wait ( 3000 ) ; // wait for the dialog code to settle
235236 cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
236237 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , room1Name ) ;
237238 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , "View" ) ;
@@ -246,7 +247,7 @@ describe("Spotlight", () => {
246247 cy . openSpotlightDialog ( ) . within ( ( ) => {
247248 cy . spotlightFilter ( Filter . PublicRooms ) ;
248249 cy . spotlightSearch ( ) . clear ( ) . type ( room2Name ) ;
249- cy . wait ( 1000 ) ; // wait for the dialog code to settle
250+ cy . wait ( 3000 ) ; // wait for the dialog code to settle
250251 cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
251252 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , room2Name ) ;
252253 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , "Join" ) ;
@@ -262,7 +263,7 @@ describe("Spotlight", () => {
262263 cy . openSpotlightDialog ( ) . within ( ( ) => {
263264 cy . spotlightFilter ( Filter . PublicRooms ) ;
264265 cy . spotlightSearch ( ) . clear ( ) . type ( room3Name ) ;
265- cy . wait ( 1000 ) ; // wait for the dialog code to settle
266+ cy . wait ( 3000 ) ; // wait for the dialog code to settle
266267 cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
267268 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , room3Name ) ;
268269 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , "View" ) ;
@@ -301,7 +302,7 @@ describe("Spotlight", () => {
301302 cy . openSpotlightDialog ( ) . within ( ( ) => {
302303 cy . spotlightFilter ( Filter . People ) ;
303304 cy . spotlightSearch ( ) . clear ( ) . type ( bot1Name ) ;
304- cy . wait ( 1000 ) ; // wait for the dialog code to settle
305+ cy . wait ( 3000 ) ; // wait for the dialog code to settle
305306 cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
306307 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , bot1Name ) ;
307308 cy . spotlightResults ( ) . eq ( 0 ) . click ( ) ;
@@ -314,7 +315,7 @@ describe("Spotlight", () => {
314315 cy . openSpotlightDialog ( ) . within ( ( ) => {
315316 cy . spotlightFilter ( Filter . People ) ;
316317 cy . spotlightSearch ( ) . clear ( ) . type ( bot2Name ) ;
317- cy . wait ( 1000 ) ; // wait for the dialog code to settle
318+ cy . wait ( 3000 ) ; // wait for the dialog code to settle
318319 cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
319320 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , bot2Name ) ;
320321 cy . spotlightResults ( ) . eq ( 0 ) . click ( ) ;
@@ -331,7 +332,7 @@ describe("Spotlight", () => {
331332 cy . openSpotlightDialog ( ) . within ( ( ) => {
332333 cy . spotlightFilter ( Filter . People ) ;
333334 cy . spotlightSearch ( ) . clear ( ) . type ( bot2Name ) ;
334- cy . wait ( 1000 ) ; // wait for the dialog code to settle
335+ cy . wait ( 3000 ) ; // wait for the dialog code to settle
335336 cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
336337 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , bot2Name ) ;
337338 cy . spotlightResults ( ) . eq ( 0 ) . click ( ) ;
@@ -345,7 +346,7 @@ describe("Spotlight", () => {
345346 . type ( "Hey!{enter}" ) ;
346347
347348 // Assert DM exists by checking for the first message and the room being in the room list
348- cy . contains ( ".mx_EventTile_body" , "Hey!" ) ;
349+ cy . contains ( ".mx_EventTile_body" , "Hey!" , { timeout : 30000 } ) ;
349350 cy . get ( ".mx_RoomSublist[aria-label=People]" ) . should ( "contain" , bot2Name ) ;
350351
351352 // Invite BotBob into existing DM with ByteBot
@@ -409,7 +410,7 @@ describe("Spotlight", () => {
409410 cy . openSpotlightDialog ( ) . within ( ( ) => {
410411 cy . spotlightFilter ( Filter . People ) ;
411412 cy . spotlightSearch ( ) . clear ( ) . type ( bot2Name ) ;
412- cy . wait ( 1000 ) ; // wait for the dialog code to settle
413+ cy . wait ( 3000 ) ; // wait for the dialog code to settle
413414 cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
414415 cy . spotlightResults ( ) . eq ( 0 ) . should ( "contain" , bot2Name ) ;
415416 cy . get ( ".mx_SpotlightDialog_startGroupChat" ) . should ( "contain" , "Start a group chat" ) ;
@@ -431,7 +432,7 @@ describe("Spotlight", () => {
431432 cy . openSpotlightDialog ( ) . within ( ( ) => {
432433 cy . spotlightFilter ( Filter . People ) ;
433434 cy . spotlightSearch ( ) . clear ( ) . type ( bot1Name ) ;
434- cy . wait ( 1000 ) ; // wait for the dialog code to settle
435+ cy . wait ( 3000 ) ; // wait for the dialog code to settle
435436 cy . get ( ".mx_Spinner" ) . should ( "not.exist" ) ;
436437 cy . spotlightResults ( ) . should ( "have.length" , 1 ) ;
437438 } ) ;
0 commit comments