@@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details.
77
88import { type Page , test , expect , type JSHandle } from "@playwright/test" ;
99
10- import type { MatrixClient } from "matrix-js-sdk/src " ;
10+ import type { MatrixClient } from "matrix-js-sdk" ;
1111
1212export type UserBaseFixture = {
1313 mxId : string ;
@@ -36,7 +36,6 @@ const CONFIG_JSON = {
3636 } ,
3737
3838 element_call : {
39- url : "https://localhost:3000" ,
4039 participant_limit : 8 ,
4140 brand : "Element Call" ,
4241 } ,
@@ -60,6 +59,21 @@ const CONFIG_JSON = {
6059 } ,
6160} ;
6261
62+ /**
63+ * Set the Element Call URL in the dev tool settings using `window.mxSettingsStore` via `page.evaluate`.
64+ * @param page
65+ */
66+ async function setDevToolElementCallDevUrl ( page : Page ) : Promise < void > {
67+ await page . evaluate ( ( ) => {
68+ window . mxSettingsStore . setValue (
69+ "Developer.elementCallUrl" ,
70+ null ,
71+ "device" ,
72+ "https://localhost:3000/room" ,
73+ ) ;
74+ } ) ;
75+ }
76+
6377export const widgetTest = test . extend < MyFixtures > ( {
6478 asWidget : async ( { browser, context } , pUse ) => {
6579 await context . route ( `http://localhost:8081/config.json*` , async ( route ) => {
@@ -88,6 +102,7 @@ export const widgetTest = test.extend<MyFixtures>({
88102 await expect (
89103 ewPage1 . getByRole ( "heading" , { name : `Welcome ${ userA } ` } ) ,
90104 ) . toBeVisible ( ) ;
105+ await setDevToolElementCallDevUrl ( ewPage1 ) ;
91106
92107 const brooksClientHandle = await ewPage1 . evaluateHandle ( ( ) =>
93108 window . mxMatrixClientPeg . get ( ) ,
@@ -115,6 +130,7 @@ export const widgetTest = test.extend<MyFixtures>({
115130 await expect (
116131 ewPage2 . getByRole ( "heading" , { name : `Welcome ${ userB } ` } ) ,
117132 ) . toBeVisible ( ) ;
133+ await setDevToolElementCallDevUrl ( ewPage2 ) ;
118134
119135 const whistlerClientHandle = await ewPage2 . evaluateHandle ( ( ) =>
120136 window . mxMatrixClientPeg . get ( ) ,
0 commit comments