Bronto plugins

Bronto plugin for Playwright

Bronto plugin for Playwright

The Bronto Playwright Plugin enhances your frontend testing suite by adding visual regression with natural language right in your Playwright tests. This documentation guides you through the setup and usage of the Bronto plugin to ensure your web apps and sites maintain visual consistency with every release.

Installation

Installation

Start by installing the necessary packages. You will need both Playwright and the Bronto plugin.

npm

Basic Usage

Basic Usage

Use Playwright’s test function to define your test case. This example navigates to a page and performs a visual regression test using Bronto:

test('Visual regression test', async ({ page }, testInfo) => {
  // Navigate to the page
  await page.goto('https://example.com');

  // Check if the title is correct
  await expect(page).toHaveTitle(/Example Domain/);

  // Perform a visual check
  await bronto('Homepage test', page, testInfo);
});

Parameters

Parameters

When calling bronto, the function expects the following parameters:

Name

Type

Description

name

string

The test name set in the Bronto UI. Keep in mind the name should match exactly.

page

Page

The page object that represents the browser page.

testInfo

TestInfo

Contains metadata about the current test run, which Bronto uses to manage test artifacts.

Authentication

Authentication

Bronto requires authentication to ensure secure access to its services. Set up your authentication credentials by creating a .env file in the root directory of your project and adding the following lines:

BRONTO_USERNAME=your_email@example.com
BRONTO_PASSWORD

Configuration

Configuration

Bronto accepts all of the config objects supported by page.screenshot like fullPage. Read more about that here.

No learning curve. Start testing with natural language with your existing tools today.

No learning curve. Start testing with natural language with your existing tools today.