Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Use puppeteer browser with Cypress to avoid installing browsers on your system yourself or in CI
const puppeteer = require('puppeteer')
* Because no browsers are bundled with Cypress we will use the already installed
* puppeteer binary that we use for Karma. This function returns information
* about the latest downloaded binary for Chrome by Puppeteer. It works for now
* but might throw errors in future, it is a workaround not a plugin.
* @see
async function getPuppeteerBrowser() {
const browserFetcher = puppeteer.createBrowserFetcher()
const revisions = await browserFetcher.localRevisions()
const revision = revisions[0] // we only care about the first revision
const info = browserFetcher.revisionInfo(revision)
* We only care about chrome and we do not want to get interrupted by a browser
* window so it is started headless.
const browser = await puppeteer.launch({
product: 'chrome',
headless: true,
let browserVersion = await browser.version()
browserVersion = browserVersion.replace('HeadlessChrome/', '')
await browser.close() // !!!
return {
name: 'chrome',
channel: 'stable',
family: 'chromium',
displayName: 'Chrome',
version: browserVersion,
path: info.executablePath,
majorVersion: browserVersion.split('.')[0],
module.exports = async (_, config) => {
const chromeBrowser = await getPuppeteerBrowser()
return config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment