Skip to content

Commit 44f1290

Browse files
committed
dewf
1 parent ac498bd commit 44f1290

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

test/regressions/index.test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@ async function main() {
77
const screenshotDir = path.resolve(__dirname, './screenshots/chrome');
88

99
const browser = await playwright.chromium.launch({
10-
args: [
11-
'--font-render-hinting=none',
12-
// Playwright hides scrollbars when taking screenshots, this causes the width to slightly change
13-
// for a brief moment. Some UI, such as responsive charts measure DOM elements in effects and
14-
// update the UI based on the width. This causes a race condition where the screenshot is taken
15-
// before the UI is updated. This makes the screenshot flaky. We can just always hide the scrollbar
16-
// to prevent this.
17-
'--hide-scrollbars',
18-
],
10+
args: ['--font-render-hinting=none'],
1911
// otherwise the loaded google Roboto font isn't applied
2012
headless: false,
2113
});

test/regressions/template.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
<style>
88
body {
99
background-color: white;
10+
/*
11+
Hide scrollbars but keep scrollable. Playwright hides scrollbar when capturing a screenshot on an element
12+
or with fullPage: true. When the body has a scrollbar, this causes a brief layout shift.
13+
*/
14+
-ms-overflow-style: none; /* Internet Explorer 10+ */
15+
scrollbar-width: none; /* Firefox */
16+
}
17+
body::-webkit-scrollbar {
18+
display: none; /* Safari and Chrome */
1019
}
1120
</style>
1221
</head>

0 commit comments

Comments
 (0)