Implement fullPage screenshots

This patch adds a 'fullPage' option to the Page.screenshot
method.

Fixes #6.
This commit is contained in:
Andrey Lushnikov
2017-06-16 22:34:29 -07:00
parent af52f13e22
commit 868814ac7f
3 changed files with 26 additions and 7 deletions

View File

@@ -258,6 +258,14 @@ describe('Puppeteer', function() {
var screenshot = await promises[1];
expect(screenshot).toBeGolden('screenshot-parallel-calls.png');
}));
it('should take fullPage screenshots', SX(async function() {
await page.setViewportSize({width: 500, height: 500});
await page.navigate(STATIC_PREFIX + '/grid.html');
var screenshot = await page.screenshot({
fullPage: true
});
expect(screenshot).toBeGolden('screenshot-grid-fullpage.png');
}));
});
});