Fix release announcement test flake (#30250)
* chore: add `hideJumpToBottomButton` option to playwright screenshot * test: hide jump to bottom button in release announcement test
This commit is contained in:
@@ -42,7 +42,10 @@ export class Helpers {
|
|||||||
*/
|
*/
|
||||||
async assertReleaseAnnouncementIsVisible(name: string) {
|
async assertReleaseAnnouncementIsVisible(name: string) {
|
||||||
await expect(this.getReleaseAnnouncement(name)).toBeVisible();
|
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,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ interface ExtendedToMatchScreenshotOptions extends ToMatchScreenshotOptions {
|
|||||||
includeDialogBackground?: boolean;
|
includeDialogBackground?: boolean;
|
||||||
showTooltips?: boolean;
|
showTooltips?: boolean;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
|
hideJumpToBottomButton?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
type Expectations = {
|
type Expectations = {
|
||||||
@@ -165,6 +166,14 @@ export const expect = baseExpect.extend<Expectations>({
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options?.hideJumpToBottomButton) {
|
||||||
|
css += `
|
||||||
|
.mx_JumpToBottomButton {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
if (options?.css) {
|
if (options?.css) {
|
||||||
css += options.css;
|
css += options.css;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user