You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Hide tooltips for certain playwright screenshots to avoid flakiness (#12770)
* Hide tooltips for certain playwright screenshots to avoid flakiness Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Typo Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * tsc Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
08ee1b8d97
commit
1082d767d4
@ -306,12 +306,22 @@ export const expect = baseExpect.extend({
|
||||
options?: {
|
||||
mask?: Array<Locator>;
|
||||
omitBackground?: boolean;
|
||||
hideTooltips?: boolean;
|
||||
timeout?: number;
|
||||
css?: string;
|
||||
},
|
||||
) {
|
||||
const page = "page" in receiver ? receiver.page() : receiver;
|
||||
|
||||
let hideTooltipsCss: string | undefined;
|
||||
if (options?.hideTooltips) {
|
||||
hideTooltipsCss = `
|
||||
.mx_Tooltip_visible {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
// We add a custom style tag before taking screenshots
|
||||
const style = (await page.addStyleTag({
|
||||
content: `
|
||||
@ -339,6 +349,7 @@ export const expect = baseExpect.extend({
|
||||
.mx_MessageTimestamp {
|
||||
font-family: Inconsolata !important;
|
||||
}
|
||||
${hideTooltipsCss ?? ""}
|
||||
${options?.css ?? ""}
|
||||
`,
|
||||
})) as ElementHandle<Element>;
|
||||
|
Reference in New Issue
Block a user