diff --git a/backend/ew.test.config.json b/backend/ew.test.config.json index 7fe0c63f..fac478dd 100644 --- a/backend/ew.test.config.json +++ b/backend/ew.test.config.json @@ -46,7 +46,6 @@ "preferred_domain": "meet.element.io" }, "element_call": { - "url": "https://localhost:3000", "participant_limit": 8, "brand": "Element Call" }, diff --git a/dev-backend-docker-compose.yml b/dev-backend-docker-compose.yml index fa07afde..8d70bfc2 100644 --- a/dev-backend-docker-compose.yml +++ b/dev-backend-docker-compose.yml @@ -70,6 +70,7 @@ services: element-web: image: ghcr.io/element-hq/element-web:develop + pull_policy: always volumes: - ./backend/ew.test.config.json:/app/config.json environment: diff --git a/playwright/fixtures/widget-user.ts b/playwright/fixtures/widget-user.ts index 391a2dd6..0a422d20 100644 --- a/playwright/fixtures/widget-user.ts +++ b/playwright/fixtures/widget-user.ts @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import { type Page, test, expect, type JSHandle } from "@playwright/test"; -import type { MatrixClient } from "matrix-js-sdk/src"; +import type { MatrixClient } from "matrix-js-sdk"; export type UserBaseFixture = { mxId: string; @@ -36,7 +36,6 @@ const CONFIG_JSON = { }, element_call: { - url: "https://localhost:3000", participant_limit: 8, brand: "Element Call", }, @@ -60,6 +59,21 @@ const CONFIG_JSON = { }, }; +/** + * Set the Element Call URL in the dev tool settings using `window.mxSettingsStore` via `page.evaluate`. + * @param page + */ +async function setDevToolElementCallDevUrl(page: Page): Promise { + await page.evaluate(() => { + window.mxSettingsStore.setValue( + "Developer.elementCallUrl", + null, + "device", + "https://localhost:3000/room", + ); + }); +} + export const widgetTest = test.extend({ asWidget: async ({ browser, context }, pUse) => { await context.route(`http://localhost:8081/config.json*`, async (route) => { @@ -88,6 +102,7 @@ export const widgetTest = test.extend({ await expect( ewPage1.getByRole("heading", { name: `Welcome ${userA}` }), ).toBeVisible(); + await setDevToolElementCallDevUrl(ewPage1); const brooksClientHandle = await ewPage1.evaluateHandle(() => window.mxMatrixClientPeg.get(), @@ -115,6 +130,7 @@ export const widgetTest = test.extend({ await expect( ewPage2.getByRole("heading", { name: `Welcome ${userB}` }), ).toBeVisible(); + await setDevToolElementCallDevUrl(ewPage2); const whistlerClientHandle = await ewPage2.evaluateHandle(() => window.mxMatrixClientPeg.get(), diff --git a/playwright/global.d.ts b/playwright/global.d.ts index 2108240e..93f38729 100644 --- a/playwright/global.d.ts +++ b/playwright/global.d.ts @@ -5,12 +5,20 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import type * as Matrix from "matrix-js-sdk/src"; +import type * as Matrix from "matrix-js-sdk"; declare global { interface Window { mxMatrixClientPeg: { get(): Matrix.MatrixClient; }; + mxSettingsStore: { + setValue: ( + settingKey: string, + room: string | null, + level: string, + setting: string, + ) => void; + }; } }