Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: scroll on mobile viewport with accelerated compositing #31992

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions tests/assets/input/scrollable-accelerated.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
<style>

.transformed {
width: 60px;
height: 60px;
transform: perspective(500px) translate3d(500px, 0, 0px);
background-color: pink;
}

.top {
position: fixed;
z-index: 1000;
top: 0;
left: 0;
right: 0;
height: 50px;
background-color: lightblue;
}

</style>
</head>
<body>
<div class="top">Header</div>
<div style="height: 3000px; background-color: antiquewhite;">
</div>
<button>Click me</button>
<div class="transformed"></div>
</body>
13 changes: 13 additions & 0 deletions tests/library/browsercontext-viewport-mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ 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, 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/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({
Expand Down
Loading