From 492e9f6d7c19bcd1f5ead61daf139921e80239a2 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Sat, 4 Feb 2023 10:32:53 -0800 Subject: [PATCH] test: scroll into view span element (#20628) https://github.com/microsoft/playwright/issues/20165 --- tests/page/page-click-scroll.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/page/page-click-scroll.spec.ts b/tests/page/page-click-scroll.spec.ts index 12bc4ada39..8d148ca45e 100644 --- a/tests/page/page-click-scroll.spec.ts +++ b/tests/page/page-click-scroll.spec.ts @@ -86,3 +86,15 @@ it('should not crash when force-clicking hidden input', async ({ page, browserNa const error = await page.locator('input').click({ force: true, timeout: 2000 }).catch(e => e); expect(error.message).toContain('Element is not visible'); }); + +it('should scroll into view span element', async ({ page, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/20165' }); + it.fixme(browserName === 'webkit'); + await page.setContent(` +
+ foo + `); + await page.locator('#small').scrollIntoViewIfNeeded(); + console.log(await page.evaluate(() => window.scrollY)); + expect(await page.evaluate(() => window.scrollY)).toBeGreaterThan(9000); +}); \ No newline at end of file