Jest-Puppeteer allows you to run tests with Jest on browsers controlled with Puppeteer.

To get started, please install the package:

npm install --save-dev jest-puppeteer puppeteer jest

Next, specify these settings in your Jest configuration file (jest.config.js):

module.exports = {
  rootDir: '.',
  testTimeout: 20000,
  testMatch: [
  preset: 'jest-puppeteer'

Configure Jest-Puppeteer

To configure Jest Puppeteer, please create a new file called jest-puppeteer.config.js and add this to the file:

module.exports = {
  connect: {
    browserWSEndpoint: 'wss://[YOUR-TOKEN]'

This instructs Jest Puppeteer to connect to our Headless grid and use the latest (headless) Chrome browser.

You can replace with the other browsers we provide.

Run your first test

To create a test, please create a new file called sample.spec.js and add this to the file:

describe('Google', () => {
  beforeAll(async () => {
    await page.goto('')

  it('should display google text on page', async () => {
    await expect(page).toMatch('google')

Now we can run our first test:

$ jest

This will open Google in a Headless Chrome browser and verify if the word google is on the page.

You should see something like this in your terminal:

PASS  ./sample.spec.js (6.503s)
    ✓ should display google text on page (81ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total

This test will also appear in your Member Dashboard.