Run your tests using Jest & Puppeteer with jest-puppeteer

With jest-puppeteer – and its included expect-puppeteer assertion library – it’s possible to use Puppeteer within your Jest tests.

Writing integration test can be done using Puppeteer API but it can be complicated and hard because API is not designed for testing.

To make it simpler, an expectPage() is automatically installed and available, it provides a lot of convenient methods, all documented in expect-puppeteer API.

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

  it('should display "google" text on page', async () => {

With expect-puppeteer it’s also easy peasy to click buttons, complete forms, etc.

// Assert that a form will be filled
await expectPage().toFillForm('form[name="myForm"]', {
  firstName: 'James',
  lastName: 'Bond',