mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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:
committed by
Andrey Lushnikov
parent
70f77c1981
commit
8870aaee17
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user