Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm getting Navigation failed because browser has disconnected! when ci=true #14

Open
mattvv opened this issue Jan 4, 2020 · 1 comment

Comments

@mattvv
Copy link

mattvv commented Jan 4, 2020

I'm not entirely sure what's happening with my tests, but here's an example:

const mockeer = require('mockeer');
const puppeteer = require('puppeteer');

describe('example test', () => {
  let browser, page;

  beforeEach(async () => {
    browser = await puppeteer.launch({
      defaultViewport: { width: 1024, height: 768 },
      ignoreHTTPSErrors: true,
      headless: true,
      args: ['--no-sandbox'],
    }); // flip headless to false to have visual representation
    page = await browser.newPage();
    await mockeer(browser);
  });

  afterEach(async () => {
    await page.close();
    await browser.close();
  });

  it('should find go to a page', async () => {
    expect(
      await page.goto(....);
    ).toBe(true);
  });

This works fine when CI=false, and the fixtures get created, but when running with CI=true, I'm getting the following:

Navigation failed because browser has disconnected!
@mattvv
Copy link
Author

mattvv commented Jan 6, 2020

Some more debugging info, when setting headless to false and playing with the CI param, it looks like the request works fine when CI is set to false, but when set to true, it appears to be not loading anything in the browser and just hanging at the goto line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant