diff --git a/test/coverage.spec.js b/test/coverage.spec.js index 0e354e0895a..67fac609956 100644 --- a/test/coverage.spec.js +++ b/test/coverage.spec.js @@ -189,5 +189,19 @@ module.exports.addTests = function({testRunner, expect}) { expect(coverage.length).toBe(0); }); }); + xit('should work with a recently loaded stylesheet', async function({page, server}) { + await page.coverage.startCSSCoverage(); + await page.evaluate(async url => { + document.body.textContent = 'hello, world'; + + const link = document.createElement('link'); + link.rel = 'stylesheet'; + link.href = url; + document.head.appendChild(link); + await new Promise(x => link.onload = x); + }, server.PREFIX + '/csscoverage/stylesheet1.css'); + const coverage = await page.coverage.stopCSSCoverage(); + expect(coverage.length).toBe(1); + }); }); };