Skip to content

Commit 428624f

Browse files
test: stabilize test locally
1 parent cb5ca5a commit 428624f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tests/tools/screenshot.test.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {describe, it} from 'node:test';
1111

1212
import {screenshot} from '../../src/tools/screenshot.js';
1313
import {screenshots} from '../snapshot.js';
14-
import {withBrowser} from '../utils.js';
14+
import {html, withBrowser} from '../utils.js';
1515

1616
describe('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

Comments
 (0)