fix(firefox): properly round clip when doing element screenshots (#4001)

Do clipping the same way we do it in Chromium.
This commit is contained in:
Andrey Lushnikov
2019-02-13 19:47:14 -08:00
committed by GitHub
parent 670d758dfe
commit 2275c3c0c8
5 changed files with 19 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

View File

@@ -23,8 +23,8 @@ const YELLOW_COLOR = '\x1b[33m';
const RESET_COLOR = '\x1b[0m';
module.exports.addTests = ({testRunner, product, puppeteer, Errors, DeviceDescriptors}) => {
const {describe, xdescribe, fdescribe, describe_fails_ffox} = testRunner;
const {it, fit, xit, it_fails_ffox} = testRunner;
const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
const CHROME = product === 'Chromium';

View File

@@ -15,7 +15,7 @@
*/
module.exports.addTests = function({testRunner, expect, product}) {
const {describe, xdescribe, fdescribe, describe_fails_ffox} = testRunner;
const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit, it_fails_ffox} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
@@ -230,7 +230,7 @@ module.exports.addTests = function({testRunner, expect, product}) {
const screenshot = await elementHandle.screenshot();
expect(screenshot).toBeGolden('screenshot-element-fractional.png');
});
it_fails_ffox('should work for an element with an offset', async({page}) => {
it('should work for an element with an offset', async({page}) => {
await page.setContent('<div style="position:absolute; top: 10.3px; left: 20.4px;width:50.3px;height:20.2px;border:1px solid black;"></div>');
const elementHandle = await page.$('div');
const screenshot = await elementHandle.screenshot();