Closed ChrystianC closed 8 months ago
['reporter junit'](reporter: [['junit', { outputFile: 'results.xml' }]],)
test('should open abc', async ({ page }) => { test.setTimeout(120 * 1000); await broadcastEditor.goto( '/Content/Edit?id=227548201&isEvent=true') const contentContainer = page.locator('.editor-content'); let shouldScroll = true; while (shouldScroll) { await expect(page).toMatchScreenshot({timeout: 15 * 1000}); shouldScroll = await contentContainer.evaluate((node) => { const { clientHeight, scrollHeight, scrollTop } = node; node.scrollBy(0, clientHeight); return scrollHeight - scrollTop - clientHeight > 1; }); } });
Function toMatchScreenshot
export const expect = baseExpect.extend<{ toMatchScreenshot(page: Page, options?: MatchScreenshotOptions): Promise<{ message: () => string; pass: boolean; }>, }>({ async toMatchScreenshot(page, { hide = [], ...options } = {}) { for (const locator of hide) { await locator.evaluateAll((nodes) => { for (const node of nodes) { node.style.visibility = 'hidden'; } }); } await baseExpect(page).toHaveScreenshot(options); return { message: () => '', pass: true }; }, });
Question
If you believe this is a Playwright bug, please follow the BUG template and provide a scenario I could reproduce locally (without external dependencies and pages specific to your app)
Closing as per above.
System info
['reporter junit'](reporter: [['junit', { outputFile: 'results.xml' }]],)
.Source code
Function toMatchScreenshot
Question