From a073cb115f13910270156f88d4d148d1486ae466 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 24 Oct 2024 10:51:43 +0100 Subject: [PATCH] Excluding floating-ui portals as part of hiding tooltips in Playwright screenshots Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- playwright/e2e/pinned-messages/index.ts | 9 +-------- playwright/e2e/release-announcement/index.ts | 2 +- playwright/element-web-test.ts | 1 + 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/playwright/e2e/pinned-messages/index.ts b/playwright/e2e/pinned-messages/index.ts index e5d08a75b7f..ac50b62294b 100644 --- a/playwright/e2e/pinned-messages/index.ts +++ b/playwright/e2e/pinned-messages/index.ts @@ -196,14 +196,7 @@ export class Helpers { */ async assertEmptyPinnedMessagesList() { const rightPanel = this.getRightPanel(); - await expect(rightPanel).toMatchScreenshot(`pinned-messages-list-empty.png`, { - // hide the tooltip "Room information" to avoid flakiness - css: ` - [data-floating-ui-portal] { - display: none !important; - } - `, - }); + await expect(rightPanel).toMatchScreenshot(`pinned-messages-list-empty.png`); } /** diff --git a/playwright/e2e/release-announcement/index.ts b/playwright/e2e/release-announcement/index.ts index 81146be70e7..59db80c3c6d 100644 --- a/playwright/e2e/release-announcement/index.ts +++ b/playwright/e2e/release-announcement/index.ts @@ -42,7 +42,7 @@ export class Helpers { */ async assertReleaseAnnouncementIsVisible(name: string) { await expect(this.getReleaseAnnouncement(name)).toBeVisible(); - await expect(this.page).toMatchScreenshot(`release-announcement-${name}.png`); + await expect(this.page).toMatchScreenshot(`release-announcement-${name}.png`, { showTooltips: true }); } /** diff --git a/playwright/element-web-test.ts b/playwright/element-web-test.ts index 93b119ee7a6..8d5229a5100 100644 --- a/playwright/element-web-test.ts +++ b/playwright/element-web-test.ts @@ -345,6 +345,7 @@ export const expect = baseExpect.extend({ if (!options?.showTooltips) { css += ` + [data-floating-ui-portal], [role="tooltip"] { visibility: hidden !important; }