diff --git a/playwright/e2e/create-room/create-room.spec.ts b/playwright/e2e/create-room/create-room.spec.ts index 4a4fee16207..654352d3b8e 100644 --- a/playwright/e2e/create-room/create-room.spec.ts +++ b/playwright/e2e/create-room/create-room.spec.ts @@ -11,7 +11,12 @@ import { test, expect } from "../../element-web-test"; test.describe("Create Room", () => { test.use({ displayName: "Jim" }); - test("should allow us to create a public room with name, topic & address set", async ({ page, user, app }) => { + test("should allow us to create a public room with name, topic & address set", async ({ + credentials, + page, + user, + app, + }) => { const name = "Test room 1"; const topic = "This room is dedicated to this test and this test only!"; @@ -27,7 +32,7 @@ test.describe("Create Room", () => { // Submit await dialog.getByRole("button", { name: "Create room" }).click(); - await expect(page).toHaveURL(/\/#\/room\/#test-room-1:localhost/); + await expect(page).toHaveURL(new RegExp(`/#/room/#test-room-1:${credentials.homeServer}`)); const header = page.locator(".mx_RoomHeader"); await expect(header).toContainText(name); }); diff --git a/playwright/e2e/editing/editing.spec.ts b/playwright/e2e/editing/editing.spec.ts index 83ae6ba2d9c..6fc9c495989 100644 --- a/playwright/e2e/editing/editing.spec.ts +++ b/playwright/e2e/editing/editing.spec.ts @@ -12,6 +12,7 @@ import type { EventType, IContent, ISendEventResponse, MsgType, Visibility } fro import { expect, test } from "../../element-web-test"; import { ElementAppPage } from "../../pages/ElementAppPage"; import { SettingLevel } from "../../../src/settings/SettingLevel"; +import { isDendrite } from "../../plugins/homeserver/dendrite"; async function sendEvent(app: ElementAppPage, roomId: string): Promise { return app.client.sendEvent(roomId, null, "m.room.message" as EventType, { @@ -31,6 +32,8 @@ function mkPadding(n: number): IContent { } test.describe("Editing", () => { + test.skip(isDendrite, "due to a Dendrite bug https://github.com/element-hq/dendrite/issues/3123"); + // Edit "Message" const editLastMessage = async (page: Page, edit: string) => { const eventTile = page.locator(".mx_RoomView_MessageList .mx_EventTile_last"); diff --git a/playwright/e2e/knock/create-knock-room.spec.ts b/playwright/e2e/knock/create-knock-room.spec.ts index 1c729ff610e..29733481ddc 100644 --- a/playwright/e2e/knock/create-knock-room.spec.ts +++ b/playwright/e2e/knock/create-knock-room.spec.ts @@ -9,8 +9,10 @@ Please see LICENSE files in the repository root for full details. import { test, expect } from "../../element-web-test"; import { waitForRoom } from "../utils"; import { Filter } from "../../pages/Spotlight"; +import { isDendrite } from "../../plugins/homeserver/dendrite"; test.describe("Create Knock Room", () => { + test.skip(isDendrite, "Dendrite does not have support for knocking"); test.use({ displayName: "Alice", labsFlags: ["feature_ask_to_join"], diff --git a/playwright/e2e/right-panel/file-panel.spec.ts b/playwright/e2e/right-panel/file-panel.spec.ts index 579ba05bb7f..1c936f43b89 100644 --- a/playwright/e2e/right-panel/file-panel.spec.ts +++ b/playwright/e2e/right-panel/file-panel.spec.ts @@ -10,6 +10,7 @@ import { Download, type Page } from "@playwright/test"; import { test, expect } from "../../element-web-test"; import { viewRoomSummaryByName } from "./utils"; +import { isDendrite } from "../../plugins/homeserver/dendrite"; const ROOM_NAME = "Test room"; const NAME = "Alice"; @@ -181,6 +182,8 @@ test.describe("FilePanel", () => { }); test.describe("download", () => { + test.skip(isDendrite, "due to a Dendrite sending Content-Disposition inline"); + test("should download an image via the link on the panel", async ({ page, context }) => { // Upload an image file await uploadFile(page, "playwright/sample-files/riot.png"); diff --git a/playwright/e2e/widgets/stickers.spec.ts b/playwright/e2e/widgets/stickers.spec.ts index 54de1b69e28..5820f2c1697 100644 --- a/playwright/e2e/widgets/stickers.spec.ts +++ b/playwright/e2e/widgets/stickers.spec.ts @@ -88,7 +88,7 @@ async function sendStickerFromPicker(page: Page) { await expect(page.locator(".mx_AppTileFullWidth#stickers")).not.toBeVisible(); } -async function expectTimelineSticker(page: Page, roomId: string, contentUri: string) { +async function expectTimelineSticker(page: Page, serverName: string, roomId: string, contentUri: string) { const contentId = contentUri.split("/").slice(-1)[0]; // Make sure it's in the right room await expect(page.locator(".mx_EventTile_sticker > a")).toHaveAttribute("href", new RegExp(`/${roomId}/`)); @@ -98,7 +98,7 @@ async function expectTimelineSticker(page: Page, roomId: string, contentUri: str // download URL. await expect(page.locator(`img[alt="${STICKER_NAME}"]`)).toHaveAttribute( "src", - new RegExp(`/localhost/${contentId}`), + new RegExp(`/${serverName}/${contentId}`), ); } @@ -145,7 +145,7 @@ test.describe("Stickers", { tag: ["@no-firefox", "@no-webkit"] }, () => { // See sendStickerFromPicker() for more detail on iframe comms. let stickerPickerUrl: string; - test("should send a sticker to multiple rooms", async ({ webserver, page, app, user, room }) => { + test("should send a sticker to multiple rooms", async ({ credentials, webserver, page, app, user, room }) => { const roomId2 = await app.client.createRoom({ name: ROOM_NAME_2 }); const { content_uri: contentUri } = await app.client.uploadContent(STICKER_IMAGE, { type: "image/png" }); const widgetHtml = getWidgetHtml(contentUri, "image/png"); @@ -156,7 +156,7 @@ test.describe("Stickers", { tag: ["@no-firefox", "@no-webkit"] }, () => { await expect(page).toHaveURL(`/#/room/${room.roomId}`); await openStickerPicker(app); await sendStickerFromPicker(page); - await expectTimelineSticker(page, room.roomId, contentUri); + await expectTimelineSticker(page, credentials.homeServer, room.roomId, contentUri); // Ensure that when we switch to a different room that the sticker // goes to the right place @@ -164,7 +164,7 @@ test.describe("Stickers", { tag: ["@no-firefox", "@no-webkit"] }, () => { await expect(page).toHaveURL(`/#/room/${roomId2}`); await openStickerPicker(app); await sendStickerFromPicker(page); - await expectTimelineSticker(page, roomId2, contentUri); + await expectTimelineSticker(page, credentials.homeServer, roomId2, contentUri); }); test("should handle a sticker picker widget missing creatorUserId", async ({ @@ -173,6 +173,7 @@ test.describe("Stickers", { tag: ["@no-firefox", "@no-webkit"] }, () => { app, user, room, + credentials, }) => { const { content_uri: contentUri } = await app.client.uploadContent(STICKER_IMAGE, { type: "image/png" }); const widgetHtml = getWidgetHtml(contentUri, "image/png"); @@ -183,7 +184,7 @@ test.describe("Stickers", { tag: ["@no-firefox", "@no-webkit"] }, () => { await expect(page).toHaveURL(`/#/room/${room.roomId}`); await openStickerPicker(app); await sendStickerFromPicker(page); - await expectTimelineSticker(page, room.roomId, contentUri); + await expectTimelineSticker(page, credentials.homeServer, room.roomId, contentUri); }); test("should render invalid mimetype as a file", async ({ webserver, page, app, user, room }) => { diff --git a/playwright/testcontainers/synapse.ts b/playwright/testcontainers/synapse.ts index 46a4bcb415c..b547da5dfdf 100644 --- a/playwright/testcontainers/synapse.ts +++ b/playwright/testcontainers/synapse.ts @@ -267,7 +267,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, @@ -299,7 +299,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(":"), }; }