Skip to content

Commit

Permalink
Restart browser once in a while during unit testing
Browse files Browse the repository at this point in the history
The unit testing on mac is unreliable, making the last tests to hang.
This seems to be related to the upstream bug: crbug.com/741689

For now, this patch restarts the browser in the middle of unit testing.
This should be reverted once the upstream is fixed.

References #100.
  • Loading branch information
aslushnikov committed Jul 20, 2017
1 parent 42edc31 commit f5215b2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test.js
Expand Up @@ -835,6 +835,14 @@ describe('Puppeteer', function() {
expect(keyboard.modifiers().Alt).toBe(false);
}));
});

// FIXME: remove this when crbug.com/741689 is fixed.
it('RESTART BROWSER crbug.com/741689', SX(async function() {
page.close();
browser = new Browser({headless, args: ['--no-sandbox']});
page = await browser.newPage();
}));

describe('Page.setUserAgent', function() {
it('should work', SX(async function() {
expect(page.userAgent()).toContain('Mozilla');
Expand Down

0 comments on commit f5215b2

Please sign in to comment.