From 66d7c6a10044a2960cc6b839fc9433be1a8b7ac9 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Thu, 3 Jul 2025 12:51:35 +0200 Subject: [PATCH] Fix release announcement test flake (#30250) * chore: add `hideJumpToBottomButton` option to playwright screenshot * test: hide jump to bottom button in release announcement test --- playwright/e2e/release-announcement/index.ts | 5 ++++- playwright/element-web-test.ts | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/playwright/e2e/release-announcement/index.ts b/playwright/e2e/release-announcement/index.ts index 3b6c2dd38a..2a2e704d74 100644 --- a/playwright/e2e/release-announcement/index.ts +++ b/playwright/e2e/release-announcement/index.ts @@ -42,7 +42,10 @@ export class Helpers { */ async assertReleaseAnnouncementIsVisible(name: string) { await expect(this.getReleaseAnnouncement(name)).toBeVisible(); - await expect(this.page).toMatchScreenshot(`release-announcement-${name}.png`, { showTooltips: true }); + await expect(this.page).toMatchScreenshot(`release-announcement-${name}.png`, { + showTooltips: true, + hideJumpToBottomButton: true, + }); } /** diff --git a/playwright/element-web-test.ts b/playwright/element-web-test.ts index 8520533461..fee9f070d8 100644 --- a/playwright/element-web-test.ts +++ b/playwright/element-web-test.ts @@ -107,6 +107,7 @@ interface ExtendedToMatchScreenshotOptions extends ToMatchScreenshotOptions { includeDialogBackground?: boolean; showTooltips?: boolean; timeout?: number; + hideJumpToBottomButton?: boolean; } type Expectations = { @@ -165,6 +166,14 @@ export const expect = baseExpect.extend({ `; } + if (options?.hideJumpToBottomButton) { + css += ` + .mx_JumpToBottomButton { + display: none !important; + } + `; + } + if (options?.css) { css += options.css; }