Skip to content

Commit

Permalink
test: unskip scroll mobile page with background-attachment: fixed
Browse files Browse the repository at this point in the history
Fixes #31551
Fixes #23573
  • Loading branch information
yury-s committed Oct 10, 2024
1 parent 7de084b commit ad1578b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/playwright-core/src/server/webkit/wkPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export class WKPage implements PageDelegate {
promises.push(session.send('Page.overrideSetting', { setting: 'PointerLockEnabled', value: !contextOptions.isMobile }));
promises.push(session.send('Page.overrideSetting', { setting: 'InputTypeMonthEnabled', value: contextOptions.isMobile }));
promises.push(session.send('Page.overrideSetting', { setting: 'InputTypeWeekEnabled', value: contextOptions.isMobile }));
promises.push(session.send('Page.overrideSetting', { setting: 'FixedBackgroundsPaintRelativeToDocument', value: contextOptions.isMobile }));
await Promise.all(promises);
}

Expand Down
11 changes: 5 additions & 6 deletions tests/library/browsercontext-viewport-mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ it.describe('mobile viewport', () => {
}
});

it('should be detectable', async ({ playwright, browser, server, browserName, platform }) => {
it('should be detectable', async ({ playwright, browser }) => {
const iPhone = playwright.devices['iPhone 6'];
const context = await browser.newContext({ ...iPhone });
const page = await context.newPage();
expect(await page.evaluate(() => 'ontouchstart' in window || !!window.TouchEvent)).toBe(true);
await context.close();
});

it('should detect touch when applying viewport with touches', async ({ browser, server, browserName, platform }) => {
it('should detect touch when applying viewport with touches', async ({ browser, server }) => {
const context = await browser.newContext({ viewport: { width: 800, height: 600 }, hasTouch: true });
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
Expand Down Expand Up @@ -154,7 +154,7 @@ it.describe('mobile viewport', () => {
await desktopPage.close();
});

it('mouse should work with mobile viewports and cross process navigations', async ({ browser, server, browserName }) => {
it('mouse should work with mobile viewports and cross process navigations', async ({ browser, server }) => {
// @see https://crbug.com/929806
const context = await browser.newContext({ viewport: { width: 360, height: 640 }, isMobile: true });
const page = await context.newPage();
Expand Down Expand Up @@ -193,8 +193,7 @@ it.describe('mobile viewport', () => {
{ 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');
}, async ({ playwright, browser, server }) => {
const iPhone = playwright.devices['iPhone 12'];
const context = await browser.newContext({ ...iPhone });
const page = await context.newPage();
Expand All @@ -204,7 +203,7 @@ it.describe('mobile viewport', () => {
await context.close();
});

it('view scale should reset after navigation', async ({ browser, browserName }) => {
it('view scale should reset after navigation', async ({ browser }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/26876' });
const context = await browser.newContext({
viewport: { width: 390, height: 664 },
Expand Down

0 comments on commit ad1578b

Please sign in to comment.