mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 05:37:20 +03:00
test: make "outerWidth and outerHeight" test work on small screens (#14124)
This commit is contained in:
parent
f562058805
commit
83d82fa466
@ -30,6 +30,7 @@ it('should set the proper viewport size', async ({ page, server }) => {
|
||||
});
|
||||
|
||||
it('should return correct outerWidth and outerHeight', async ({ page }) => {
|
||||
await page.setViewportSize({ width: 410, height: 420 });
|
||||
const size = await page.evaluate(() => {
|
||||
return {
|
||||
innerWidth: window.innerWidth,
|
||||
@ -38,8 +39,8 @@ it('should return correct outerWidth and outerHeight', async ({ page }) => {
|
||||
outerHeight: window.outerHeight,
|
||||
};
|
||||
});
|
||||
expect(size.innerWidth).toBe(1280);
|
||||
expect(size.innerHeight).toBe(720);
|
||||
expect(size.innerWidth).toBe(410);
|
||||
expect(size.innerHeight).toBe(420);
|
||||
expect(size.outerWidth >= size.innerWidth).toBeTruthy();
|
||||
expect(size.outerHeight >= size.innerHeight).toBeTruthy();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user