mirror of
https://github.com/microsoft/playwright.git
synced 2024-10-27 05:46:28 +03:00
test: should take fullPage screenshots and mask elements outside of it (#30802)
Regression test for #30770.
This commit is contained in:
parent
c8c37009c3
commit
27ce5c0226
@ -221,6 +221,17 @@ it.describe('page screenshot', () => {
|
||||
expect(screenshot).toMatchSnapshot('screenshot-grid-fullpage.png');
|
||||
});
|
||||
|
||||
it('should take fullPage screenshots and mask elements outside of it', async ({ page, server }) => {
|
||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/30770' });
|
||||
await page.setViewportSize({ width: 500, height: 500 });
|
||||
await page.goto(server.PREFIX + '/grid.html');
|
||||
const screenshot = await page.screenshot({
|
||||
fullPage: true,
|
||||
mask: [page.locator('.box').nth(144)],
|
||||
});
|
||||
expect(screenshot).toMatchSnapshot('screenshot-grid-fullpage-mask-outside-viewport.png');
|
||||
});
|
||||
|
||||
it('should restore viewport after fullPage screenshot', async ({ page, server }) => {
|
||||
await page.setViewportSize({ width: 500, height: 500 });
|
||||
await page.goto(server.PREFIX + '/grid.html');
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
Binary file not shown.
After Width: | Height: | Size: 96 KiB |
Binary file not shown.
After Width: | Height: | Size: 81 KiB |
Loading…
Reference in New Issue
Block a user