diff --git a/tests/tools/screenshot.test.ts b/tests/tools/screenshot.test.ts index d369f2ca..c5b3a460 100644 --- a/tests/tools/screenshot.test.ts +++ b/tests/tools/screenshot.test.ts @@ -11,7 +11,7 @@ import {describe, it} from 'node:test'; import {screenshot} from '../../src/tools/screenshot.js'; import {screenshots} from '../snapshot.js'; -import {withBrowser} from '../utils.js'; +import {html, withBrowser} from '../utils.js'; describe('screenshot', () => { describe('browser_take_screenshot', () => { @@ -77,9 +77,20 @@ describe('screenshot', () => { it('with full page resulting in a large screenshot', async () => { await withBrowser(async (response, context) => { const page = context.getSelectedPage(); + await page.setContent( - `
test
`.repeat(7_000), + html`${`
test
`.repeat(6500)} +
test
`, ); + await page.evaluate(() => { + const el = document.querySelector('#red'); + return el?.scrollIntoViewIfNeeded(); + }); + await screenshot.handler( {params: {format: 'png', fullPage: true}}, response,