diff --git a/cypress/e2e/threads/threads.spec.ts b/cypress/e2e/threads/threads.spec.ts index ee1fd78d08..1d36cbdd85 100644 --- a/cypress/e2e/threads/threads.spec.ts +++ b/cypress/e2e/threads/threads.spec.ts @@ -31,7 +31,6 @@ describe("Threads", () => { }); cy.startHomeserver("default").then((data) => { homeserver = data; - cy.initTestUser(homeserver, "Tom"); }); }); @@ -50,12 +49,15 @@ describe("Threads", () => { }); let roomId: string; - cy.createRoom({}).then((_roomId) => { - roomId = _roomId; - cy.inviteUser(roomId, bot.getUserId()); - bot.joinRoom(roomId); - cy.visit("/#/room/" + roomId); - }); + cy.createRoom({}) + .then((_roomId) => { + roomId = _roomId; + return cy.inviteUser(roomId, bot.getUserId()); + }) + .then(async () => { + await bot.joinRoom(roomId); + cy.visit("/#/room/" + roomId); + }); // Around 200 characters const MessageLong = @@ -407,12 +409,15 @@ describe("Threads", () => { }); let roomId: string; - cy.createRoom({}).then((_roomId) => { - roomId = _roomId; - cy.inviteUser(roomId, bot.getUserId()); - bot.joinRoom(roomId); - cy.visit("/#/room/" + roomId); - }); + cy.createRoom({}) + .then((_roomId) => { + roomId = _roomId; + return cy.inviteUser(roomId, bot.getUserId()); + }) + .then(async () => { + await bot.joinRoom(roomId); + cy.visit("/#/room/" + roomId); + }); // Exclude timestamp, read marker, and mapboxgl-map from snapshots const percyCSS = diff --git a/cypress/support/client.ts b/cypress/support/client.ts index c56608fadc..535669d6be 100644 --- a/cypress/support/client.ts +++ b/cypress/support/client.ts @@ -174,7 +174,9 @@ Cypress.Commands.add("createSpace", (options: ICreateRoomOpts): Chainable => { return cy.getClient().then(async (cli: MatrixClient) => { - return cli.invite(roomId, userId); + const res = await cli.invite(roomId, userId); + Cypress.log({ name: "inviteUser", message: `sent invite in ${roomId} for ${userId}` }); + return res; }); }); diff --git a/cypress/support/homeserver.ts b/cypress/support/homeserver.ts index 3026c94b06..f233c4d41e 100644 --- a/cypress/support/homeserver.ts +++ b/cypress/support/homeserver.ts @@ -58,7 +58,9 @@ declare global { function startHomeserver(template: string): Chainable { const homeserverName = Cypress.env("HOMESERVER"); - return cy.task(homeserverName + "Start", template); + return cy.task(homeserverName + "Start", template, { log: false }).then((x) => { + Cypress.log({ name: "startHomeserver", message: `Started homeserver instance ${x.serverId}` }); + }); } function stopHomeserver(homeserver?: HomeserverInstance): Chainable {