test: make sure zero-width screenshots don't hang (#3214)

References #2672.
This commit is contained in:
Andrey Lushnikov 2018-09-11 19:07:57 +01:00 committed by GitHub
parent 9c4b6d06e2
commit c644a3bbd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -303,6 +303,11 @@ module.exports.addTests = function({testRunner, expect}) {
const screenshotError = await elementHandle.screenshot().catch(error => error);
expect(screenshotError.message).toBe('Node is either not visible or not an HTMLElement');
});
xit('should not hang with zero width/height element', async({page, server}) => {
await page.setContent('<div style="width: 0; height: 0"></div>');
const div = await page.$('div');
await div.screenshot();
});
});
describe('ElementHandle.$', function() {