From 38e9ad5ba62cc4f5f704630d2d0ccaf7609c8679 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 2 Aug 2024 17:53:54 -0700 Subject: [PATCH] test: scroll on mobile viewport with accelerated compositing Reference: https://github.com/microsoft/playwright/issues/31551 --- .../assets/input/scrollable-accelerated.html | 30 +++++++++++++++++++ .../browsercontext-viewport-mobile.spec.ts | 12 ++++++++ 2 files changed, 42 insertions(+) create mode 100644 tests/assets/input/scrollable-accelerated.html diff --git a/tests/assets/input/scrollable-accelerated.html b/tests/assets/input/scrollable-accelerated.html new file mode 100644 index 00000000000000..5f19d148a96072 --- /dev/null +++ b/tests/assets/input/scrollable-accelerated.html @@ -0,0 +1,30 @@ + + + + + +
Header
+
+
+ +
+ diff --git a/tests/library/browsercontext-viewport-mobile.spec.ts b/tests/library/browsercontext-viewport-mobile.spec.ts index 8160d5601e3146..4ae9735c5a9805 100644 --- a/tests/library/browsercontext-viewport-mobile.spec.ts +++ b/tests/library/browsercontext-viewport-mobile.spec.ts @@ -190,6 +190,18 @@ it.describe('mobile viewport', () => { await context.close(); }); + it('should scroll when accelerating compositing needed', { + annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31551' } + }, async ({ playwright, browser, server }) => { + const iPhone = playwright.devices['iPhone 12']; + const context = await browser.newContext({ ...iPhone }); + const page = await context.newPage(); + await page.goto(server.PREFIX + '/input/scrollable-accelerated.html'); + await page.getByRole('button').click(); + expect(await page.evaluate(() => window.scrollY)).toBeGreaterThan(1000); + await context.close(); + }); + it('view scale should reset after navigation', async ({ browser, browserName }) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/26876' }); const context = await browser.newContext({