Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: display:contents should be scrollable into view (#15765)

Dmitry Gozman7396a20277eb
diff --git a/tests/page/elementhandle-scroll-into-view.spec.ts b/tests/page/elementhandle-scroll-into-view.spec.ts
index 20347e03c2..918afebbe0 100644
--- a/tests/page/elementhandle-scroll-into-view.spec.ts
+++ b/tests/page/elementhandle-scroll-into-view.spec.ts
@@ -60,9 +60,21 @@ it('should wait for display:none to become visible', async ({ page, server }) =>
await testWaiting(page, div => div.style.display = 'block');
});
-it('should wait for display:contents to become visible', async ({ page, server }) => {
- await page.setContent('<div style="display:contents">Hello</div>');
- await testWaiting(page, div => div.style.display = 'block');
+it.fixme('should scroll display:contents into view', async ({ page, server }) => {
+ it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/15034' });
+
+ await page.setContent(`
+ <div id=container style="width:200px;height:200px;overflow:scroll;border:1px solid black;">
+ <div style="margin-top:500px;background:red;">
+ <div style="height:50px;width:100px;background:cyan;">
+ <div id=target style="display:contents">Hello</div>
+ </div>
+ <div>
+ </div>
+ `);
+ const div = await page.$('#target');
+ await div.scrollIntoViewIfNeeded();
+ expect(await page.$eval('#container', e => e.scrollTop)).toBe(350);
});
it('should work for visibility:hidden element', async ({ page }) => {