From 0079270fa5644e95a1bab68a98719d31a82d4123 Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Mon, 30 Mar 2026 18:16:44 +0530 Subject: [PATCH 1/2] Lock width when running most playwright tests --- .../src/index.ts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/element-web-playwright-common/src/index.ts b/packages/element-web-playwright-common/src/index.ts index 518def9eaa..afc92244e4 100644 --- a/packages/element-web-playwright-common/src/index.ts +++ b/packages/element-web-playwright-common/src/index.ts @@ -66,6 +66,16 @@ export interface TestFixtures { labsFlags: string[]; disablePresence: boolean; + /** + * Whether the left panel should have its width fixed. + * This is done because the library that we use for rendering collapsible + * panels uses math to calculate the width which can sometimes leads to +/-1px + * difference. While this does not matter to the user, it can lead to screenshot + * tests failing. + * Defaults to true, should be set to false via {@link base.use} when you want to test the collapse + * behaviour. + */ + lockLeftPanelWidth: boolean; } export const test = base.extend({ @@ -73,8 +83,18 @@ export const test = base.extend({ config: async ({}, use) => use({}), labsFlags: async ({}, use) => use([]), disablePresence: async ({}, use) => use(false), - page: async ({ homeserver, context, page, config, labsFlags, disablePresence }, use) => { + lockLeftPanelWidth: true, + page: async ({ homeserver, context, page, config, labsFlags, disablePresence, lockLeftPanelWidth }, use) => { await routeConfigJson(context, homeserver.baseUrl, config, labsFlags, disablePresence); + if (lockLeftPanelWidth) { + await page.addStyleTag({ + content: ` + #left-panel { + flex: 0 0 369.6875px !important; + } + `, + }); + } await use(page); }, }); From 72de8745e939434afdcf86a4c66d832a2e075d6b Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Mon, 30 Mar 2026 19:56:58 +0530 Subject: [PATCH 2/2] Bump package version --- packages/element-web-playwright-common/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/element-web-playwright-common/package.json b/packages/element-web-playwright-common/package.json index a31149a2c4..09480c689a 100644 --- a/packages/element-web-playwright-common/package.json +++ b/packages/element-web-playwright-common/package.json @@ -1,7 +1,7 @@ { "name": "@element-hq/element-web-playwright-common", "type": "module", - "version": "2.2.7", + "version": "2.3.0", "license": "SEE LICENSE IN README.md", "repository": { "type": "git",