---
title: Puppeteer Jest Cloud Testing | TestingBot
description: Run Jest + Puppeteer tests in the TestingBot cloud on Chrome and Microsoft
  Edge. Use jest-puppeteer or puppeteer.connect() to run your existing Jest suite
  against a remote browser grid in parallel.
source_url:
  html: https://testingbot.com/support/web-automate/puppeteer/jest
  md: https://testingbot.com/support/web-automate/puppeteer/jest.md
---

# Puppeteer & Jest

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

To get started, please install these packages:

```bash
npm install --save-dev jest-puppeteer puppeteer jest
```

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

```javascript
module.exports = {
  rootDir: '.',
  testTimeout: 20000,
  testMatch: [
    '<rootDir>/*.spec.js'
  ],
  preset: 'jest-puppeteer'
}
```

## Configure Jest with Puppeteer

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

```javascript
module.exports = {
  connect: {
    browserWSEndpoint: 'wss://cloud.testingbot.com?key=API_KEY&secret=API_SECRET&browserName=chrome&browserVersion=latest'
  }
}
```

This instructs Jest and Puppeteer to connect to the TestingBot browser grid.

## Specifying browser and version

To specify on which browser and version your Jest + Puppeteer test should run, you can include both a `browserName` and `browserVersion` in the `browserWSEndpoint` URL.

  ![OS selected](https://testingbot.com/assets/environments/svg/windows11-0e1b28bc0fdd5034d3e4d3dc8d346c500a8c6522facf4b45d0da56537c1f1c6d.svg) Windows 11 › ![Browser selected](https://testingbot.com/assets/environments/svg/chrome-c4081ff447d2d898d4afcb8f074a907c960e6f007716c1a1d119eee6803c4042.svg) Chrome 139 

Loading environments...

Please wait while we load the available browsers and platforms.

## Run your first test

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

```javascript
describe('Google', () => {
  beforeAll(async () => {
    await page.goto('https://google.com')
  })

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

Now you can run your first test with Puppeteer on the TestingBot cloud:

```bash
jest
```

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

You should see something like this in your terminal after running the command:

```
PASS ./sample.spec.js (6.503s)
  Google
    ✓ 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](https://testingbot.com/members).

### Looking for more help?

Have questions or need more information? Reach out via email or Slack.

[Email us](https://testingbot.com/contact/new) [Join our Slack](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
