test: add page.screenshot viewport clipping test (#5079)
This commit is contained in:
parent
7f3e372b14
commit
360c1b4c7d
BIN
test/golden-chromium/screenshot-offscreen-clip.png
Normal file
BIN
test/golden-chromium/screenshot-offscreen-clip.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 326 B |
BIN
test/golden-firefox/screenshot-offscreen-clip.png
Normal file
BIN
test/golden-firefox/screenshot-offscreen-clip.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 326 B |
@ -39,6 +39,19 @@ module.exports.addTests = function({testRunner, expect, product}) {
|
||||
});
|
||||
expect(screenshot).toBeGolden('screenshot-clip-rect.png');
|
||||
});
|
||||
it_fails_ffox('should clip elements to the viewport', async({page, server}) => {
|
||||
await page.setViewport({width: 500, height: 500});
|
||||
await page.goto(server.PREFIX + '/grid.html');
|
||||
const screenshot = await page.screenshot({
|
||||
clip: {
|
||||
x: 50,
|
||||
y: 600,
|
||||
width: 100,
|
||||
height: 100
|
||||
}
|
||||
});
|
||||
expect(screenshot).toBeGolden('screenshot-offscreen-clip.png');
|
||||
});
|
||||
it('should run in parallel', async({page, server}) => {
|
||||
await page.setViewport({width: 500, height: 500});
|
||||
await page.goto(server.PREFIX + '/grid.html');
|
||||
|
Loading…
Reference in New Issue
Block a user