Skip to content

Commit

Permalink
test(CSSCoverage): failing test when a stylesheet was recently added (#…
Browse files Browse the repository at this point in the history
…3400)

If nobody forces a layout, CSS coverage is inconsistent. This causes some flakes on the bots. The test in this PR fails 90% of the time on my local machine.
  • Loading branch information
JoelEinbinder authored and aslushnikov committed Oct 12, 2018
1 parent a04dedc commit 0fd3bfb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/coverage.spec.js
Expand Up @@ -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);
});
});
};

0 comments on commit 0fd3bfb

Please sign in to comment.