@@ -11,7 +11,7 @@ import {describe, it} from 'node:test';
1111
1212import { screenshot } from '../../src/tools/screenshot.js' ;
1313import { screenshots } from '../snapshot.js' ;
14- import { withBrowser } from '../utils.js' ;
14+ import { html , withBrowser } from '../utils.js' ;
1515
1616describe ( 'screenshot' , ( ) => {
1717 describe ( 'browser_take_screenshot' , ( ) => {
@@ -74,12 +74,23 @@ describe('screenshot', () => {
7474 } ) ;
7575 } ) ;
7676
77- it ( 'with full page resulting in a large screenshot' , async ( ) => {
77+ it . only ( 'with full page resulting in a large screenshot' , async ( ) => {
7878 await withBrowser ( async ( response , context ) => {
7979 const page = context . getSelectedPage ( ) ;
80+
8081 await page . setContent (
81- `<div style="color:blue;">test</div>` . repeat ( 7_000 ) ,
82+ html `${ `<div style="color:blue;">test</div>` . repeat ( 6500 ) }
83+ < div
84+ id ="red "
85+ style ="color:blue; "
86+ > test</ div
87+ > ` ,
8288 ) ;
89+ await page . evaluate ( ( ) => {
90+ const el = document . querySelector ( '#red' ) ;
91+ return el ?. scrollIntoViewIfNeeded ( ) ;
92+ } ) ;
93+
8394 await screenshot . handler (
8495 { params : { format : 'png' , fullPage : true } } ,
8596 response ,
0 commit comments