diff --git a/playwright/e2e/crypto/invisible-crypto.spec.ts b/playwright/e2e/crypto/invisible-crypto.spec.ts index f1272ec710..198abdac6d 100644 --- a/playwright/e2e/crypto/invisible-crypto.spec.ts +++ b/playwright/e2e/crypto/invisible-crypto.spec.ts @@ -11,6 +11,7 @@ import { bootstrapCrossSigningForClient } from "../../pages/client.ts"; /** Tests for the "invisible crypto" behaviour -- i.e., when the "exclude insecure devices" setting is enabled */ test.describe("Invisible cryptography", () => { + test.slow(); test.use({ displayName: "Alice", botCreateOpts: { displayName: "Bob" }, diff --git a/playwright/e2e/integration-manager/kick.spec.ts b/playwright/e2e/integration-manager/kick.spec.ts index b12215fe33..b1aa9eff52 100644 --- a/playwright/e2e/integration-manager/kick.spec.ts +++ b/playwright/e2e/integration-manager/kick.spec.ts @@ -69,29 +69,13 @@ async function sendActionFromIntegrationManager( await iframe.getByRole("button", { name: "Press to send action" }).click(); } -async function clickUntilGone(page: Page, selector: string, attempt = 0) { - if (attempt === 11) { - throw new Error("clickUntilGone attempt count exceeded"); - } - - await page.locator(selector).last().click(); - - const count = await page.locator(selector).count(); - if (count > 0) { - return clickUntilGone(page, selector, ++attempt); - } -} - async function expectKickedMessage(page: Page, shouldExist: boolean) { - // Expand any event summaries, we can't use a click multiple here because clicking one might de-render others - // This is quite horrible but seems the most stable way of clicking 0-N buttons, - // one at a time with a full re-evaluation after each click - await clickUntilGone(page, ".mx_GenericEventListSummary_toggle[aria-expanded=false]"); - - // Check for the event message (or lack thereof) - await expect(page.getByText(`${USER_DISPLAY_NAME} removed ${BOT_DISPLAY_NAME}: ${KICK_REASON}`)).toBeVisible({ - visible: shouldExist, - }); + await expect(async () => { + await page.locator(".mx_GenericEventListSummary_toggle[aria-expanded=false]").last().click(); + await expect(page.getByText(`${USER_DISPLAY_NAME} removed ${BOT_DISPLAY_NAME}: ${KICK_REASON}`)).toBeVisible({ + visible: shouldExist, + }); + }).toPass(); } test.describe("Integration Manager: Kick", () => { diff --git a/playwright/e2e/read-receipts/reactions-in-threads.spec.ts b/playwright/e2e/read-receipts/reactions-in-threads.spec.ts index eb733d3a12..350140965c 100644 --- a/playwright/e2e/read-receipts/reactions-in-threads.spec.ts +++ b/playwright/e2e/read-receipts/reactions-in-threads.spec.ts @@ -70,11 +70,7 @@ test.describe("Read receipts", { tag: "@mergequeue" }, () => { // Given a thread exists and I have marked it as read await util.goTo(room1); await util.assertRead(room2); - await util.receiveMessages(room2, [ - "Msg1", - msg.threadedOff("Msg1", "Reply1"), - msg.reactionTo("Reply1", "🪿"), - ]); + await util.receiveMessages(room2, ["Msg1", msg.threadedOff("Msg1", "Reply1")]); await util.assertUnread(room2, 1); await util.markAsRead(room2); await util.assertRead(room2); diff --git a/playwright/e2e/timeline/timeline.spec.ts b/playwright/e2e/timeline/timeline.spec.ts index 26d286b53a..885c15d90f 100644 --- a/playwright/e2e/timeline/timeline.spec.ts +++ b/playwright/e2e/timeline/timeline.spec.ts @@ -603,7 +603,12 @@ test.describe("Timeline", () => { await messageEdit(page); // Click timestamp to highlight hidden event line - await page.locator(".mx_RoomView_body .mx_EventTile_info .mx_MessageTimestamp").click(); + const timestamp = page.locator(".mx_RoomView_body .mx_EventTile_info a", { + has: page.locator(".mx_MessageTimestamp"), + }); + // wait for the remote echo otherwise we get an error modal due to a 404 on the /event/ API + await expect(timestamp).not.toHaveAttribute("href", /~!/); + await timestamp.locator(".mx_MessageTimestamp").click(); // should not add inline start padding to a hidden event line on IRC layout await app.settings.setValue("layout", null, SettingLevel.DEVICE, Layout.IRC); diff --git a/playwright/services.ts b/playwright/services.ts index 0703df60d6..c5d1e278d1 100644 --- a/playwright/services.ts +++ b/playwright/services.ts @@ -99,8 +99,8 @@ export const test = base.extend({ { scope: "worker" }, ], mailhogClient: async ({ mailhog: container }, use) => { - await use(container.client); await container.client.deleteAll(); + await use(container.client); }, synapseConfig: [{}, { scope: "worker" }], @@ -141,6 +141,5 @@ export const test = base.extend({ await logger.onTestStarted(context); await use(context); await logger.onTestFinished(testInfo); - await mailhogClient.deleteAll(); }, }); diff --git a/playwright/testcontainers/synapse.ts b/playwright/testcontainers/synapse.ts index 22bfd9f665..3469082d10 100644 --- a/playwright/testcontainers/synapse.ts +++ b/playwright/testcontainers/synapse.ts @@ -277,7 +277,7 @@ export class StartedSynapseContainer extends AbstractStartedContainer implements const data = await res.json(); return { - homeServer: data.home_server, + homeServer: data.home_server || data.user_id.split(":").slice(1).join(":"), accessToken: data.access_token, userId: data.user_id, deviceId: data.device_id, @@ -310,7 +310,7 @@ export class StartedSynapseContainer extends AbstractStartedContainer implements accessToken: json.access_token, userId: json.user_id, deviceId: json.device_id, - homeServer: json.home_server, + homeServer: json.home_server || json.user_id.split(":").slice(1).join(":"), username: userId.slice(1).split(":")[0], }; }