add option to record on DOMContentLoaded event (#1109)

This commit is contained in:
Yun Feng
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 306da78607
commit a6da9ba8d0
7 changed files with 117 additions and 11 deletions

View File

@@ -984,4 +984,19 @@ describe('record integration tests', function (this: ISuite) {
)) as eventWithTime[];
assertSnapshot(snapshots);
});
it('should record after DOMContentLoaded event', async () => {
const page: puppeteer.Page = await browser.newPage();
await page.goto('about:blank');
await page.setContent(
getHtml.call(this, 'blank.html', {
recordAfter: 'DOMContentLoaded',
}),
);
const snapshots = (await page.evaluate(
'window.snapshots',
)) as eventWithTime[];
assertSnapshot(snapshots);
});
});