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

Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy committed Oct 24, 2024
1 parent 6d0d237 commit a073cb1
Show file tree
Hide file tree
Showing 3 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

0 comments on commit a073cb1

Please sign in to comment.