Disable and enable some tests based on whether chrome is headless (#154)

This patch:
- Runs dialog test in headful mode only
- Runs pdf test in headless mode only
- Improves on documentation to outline these shortcomings
This commit is contained in:
JoelEinbinder
2017-07-27 11:44:18 -07:00
committed by Andrey Lushnikov
parent 70f77c1981
commit 8870aaee17
2 changed files with 7 additions and 4 deletions

View File

@@ -647,7 +647,7 @@ describe('Puppeteer', function() {
page.evaluate(() => alert('yo'));
});
// TODO Enable this when crbug.com/718235 is fixed.
xit('should allow accepting prompts', SX(async function(done) {
(headless ? xit : it)('should allow accepting prompts', SX(async function(done) {
page.on('dialog', dialog => {
expect(dialog.type).toBe('prompt');
expect(dialog.message()).toBe('question?');
@@ -1209,7 +1209,8 @@ describe('Puppeteer', function() {
fs.unlinkSync(outputFile);
});
it('should print to pdf', SX(async function() {
// Printing to pdf is currently only supported in headless
(headless ? it : xit)('should print to pdf', SX(async function() {
await page.navigate(PREFIX + '/grid.html');
await page.pdf({path: outputFile});
expect(fs.readFileSync(outputFile).byteLength).toBeGreaterThan(0);