How to use the puppeteer._browser function in puppeteer

To help you get started, we’ve selected a few puppeteer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github boyney123 / graphql.explore-tech.org / src / scripts / create-material / spec.js View on Github external
it('sets up puppeteer and takes a screen shot of the given repos homepage when its defined', async () => {
      const result = await script(scriptArgs)
      expect(puppeteer._browser.newPage).toHaveBeenCalled()
      expect(puppeteer._page.setViewport).toHaveBeenCalledWith({
        width: 1400,
        height: 1080,
      })
      expect(puppeteer._page.goto).toHaveBeenCalledWith('homepage.com')
      expect(puppeteer._page.screenshot).toHaveBeenCalledWith({
        path: path.join(
          __dirname,
          'tmp/Examples/graphql.explore-tech.org/screenshot.png'
        ),
      })
    })