File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff 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 } ) ;
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments