Skip to content

Commit

Permalink
test: scroll mobile page with background-attachment: fixed (#31992)
Browse files Browse the repository at this point in the history
Reference: #31551
Reference: #23573
  • Loading branch information
yury-s authored Oct 4, 2024
1 parent 6b1d036 commit d7020cb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/assets/input/background-fixed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
<style>

body {
background: #fff url("/pptr.png") no-repeat center 30px;
background-attachment: fixed;
margin-top: 36px;
}

</style>
</head>
<body>
<div style="height: 3000px; background-color: antiquewhite;">tall</div>
<button>Click me</button>
</body>
16 changes: 16 additions & 0 deletions tests/library/browsercontext-viewport-mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,22 @@ it.describe('mobile viewport', () => {
await context.close();
});

it('should scroll mobile page with background-attachment: fixed', {
annotation: [
{ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31551' },
{ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/23573' },
]
}, async ({ playwright, browser, server, browserName, isLinux, headless }) => {
it.fixme(browserName === 'webkit' && isLinux && headless, 'Fails on WPE apparently due to accelerated compositing + fixed layout');
const iPhone = playwright.devices['iPhone 12'];
const context = await browser.newContext({ ...iPhone });
const page = await context.newPage();
await page.goto(server.PREFIX + '/input/background-fixed.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({
Expand Down

0 comments on commit d7020cb

Please sign in to comment.