mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: newContext works when both screen and viewport specified (#9520)
This commit is contained in:
parent
f6a768b67b
commit
3d14c1ff51
@ -105,6 +105,19 @@ browserTest('should support touch with null viewport', async ({ browser, server
|
|||||||
await context.close();
|
await context.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should set both screen and viewport options', async ({ contextFactory, browserName }) => {
|
||||||
|
it.fail(browserName === 'firefox', 'Screen size is reset to viewport');
|
||||||
|
const context = await contextFactory({
|
||||||
|
screen: { 'width': 1280, 'height': 720 },
|
||||||
|
viewport: { 'width': 1000, 'height': 600 },
|
||||||
|
});
|
||||||
|
const page = await context.newPage();
|
||||||
|
const screen = await page.evaluate(() => ({ w: screen.width, h: screen.height }));
|
||||||
|
expect(screen).toEqual({ w: 1280, h: 720 });
|
||||||
|
const inner = await page.evaluate(() => ({ w: window.innerWidth, h: window.innerHeight }));
|
||||||
|
expect(inner).toEqual({ w: 1000, h: 600 });
|
||||||
|
});
|
||||||
|
|
||||||
browserTest('should report null viewportSize when given null viewport', async ({ browser, server }) => {
|
browserTest('should report null viewportSize when given null viewport', async ({ browser, server }) => {
|
||||||
const context = await browser.newContext({ viewport: null });
|
const context = await browser.newContext({ viewport: null });
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user