mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: set JPG background to white when omitBackground option is used (#3240)
Fixes #3234
This commit is contained in:
committed by
Andrey Lushnikov
parent
6ec3ce6920
commit
d929f7e213
@@ -1656,6 +1656,12 @@ module.exports.addTests = function({testRunner, expect, headless}) {
|
||||
const screenshot = await page.screenshot({omitBackground: true});
|
||||
expect(screenshot).toBeGolden('transparent.png');
|
||||
});
|
||||
it('should render white background on jpeg file', async({page, server}) => {
|
||||
await page.setViewport({ width: 100, height: 100 });
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
const screenshot = await page.screenshot({omitBackground: true, type: 'jpeg'});
|
||||
expect(screenshot).toBeGolden('white.jpg');
|
||||
});
|
||||
it('should work with odd clip size on Retina displays', async({page, server}) => {
|
||||
const screenshot = await page.screenshot({
|
||||
clip: {
|
||||
|
||||
Reference in New Issue
Block a user