@@ -60,6 +60,21 @@ const CONFIG_JSON = {
6060 } ,
6161} ;
6262
63+ /**
64+ * Set the Element Call URL in the dev tool settings using `window.mxSettingsStore` via `page.evaluate`.
65+ * @param page
66+ */
67+ async function setDevToolElementCallDevUrl ( page : Page ) : Promise < void > {
68+ await page . evaluate ( ( ) => {
69+ window . mxSettingsStore . setValue (
70+ "Developer.elementCallUrl" ,
71+ null ,
72+ "device" ,
73+ "https://localhost:3000/room" ,
74+ ) ;
75+ } ) ;
76+ }
77+
6378export const widgetTest = test . extend < MyFixtures > ( {
6479 asWidget : async ( { browser, context } , pUse ) => {
6580 await context . route ( `http://localhost:8081/config.json*` , async ( route ) => {
@@ -88,14 +103,7 @@ export const widgetTest = test.extend<MyFixtures>({
88103 await expect (
89104 ewPage1 . getByRole ( "heading" , { name : `Welcome ${ userA } ` } ) ,
90105 ) . toBeVisible ( ) ;
91- await ewPage1 . evaluate ( ( ) => {
92- window . mxSettingsStore . setValue (
93- "Developer.elementCallUrl" ,
94- null ,
95- "device" ,
96- "https://localhost:3000/room" ,
97- ) ;
98- } ) ;
106+ await setDevToolElementCallDevUrl ( ewPage1 ) ;
99107
100108 const brooksClientHandle = await ewPage1 . evaluateHandle ( ( ) =>
101109 window . mxMatrixClientPeg . get ( ) ,
@@ -123,14 +131,7 @@ export const widgetTest = test.extend<MyFixtures>({
123131 await expect (
124132 ewPage2 . getByRole ( "heading" , { name : `Welcome ${ userB } ` } ) ,
125133 ) . toBeVisible ( ) ;
126- await ewPage2 . evaluate ( ( ) => {
127- window . mxSettingsStore . setValue (
128- "Developer.elementCallUrl" ,
129- null ,
130- "device" ,
131- "https://localhost:3000/room" ,
132- ) ;
133- } ) ;
134+ await setDevToolElementCallDevUrl ( ewPage2 ) ;
134135
135136 const whistlerClientHandle = await ewPage2 . evaluateHandle ( ( ) =>
136137 window . mxMatrixClientPeg . get ( ) ,
0 commit comments