Skip to content

Commit

Permalink
Excluding floating-ui portals as part of hiding tooltips in Playwrigh…
Browse files Browse the repository at this point in the history
…t screenshots (#28287)

* Excluding floating-ui portals as part of hiding tooltips in Playwright screenshots

Signed-off-by: Michael Telatynski <[email protected]>

* Update screenshot

Signed-off-by: Michael Telatynski <[email protected]>

---------

Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy authored Oct 28, 2024
1 parent ef60526 commit 954ff0a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
9 changes: 1 addition & 8 deletions playwright/e2e/pinned-messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion playwright/e2e/release-announcement/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}

/**
Expand Down
1 change: 1 addition & 0 deletions playwright/element-web-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ export const expect = baseExpect.extend({

if (!options?.showTooltips) {
css += `
[data-floating-ui-portal],
[role="tooltip"] {
visibility: hidden !important;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 954ff0a

Please sign in to comment.