DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

How to Integrate Applitools Eyes with Puppeteer

A practical guide to Applitools Eyes with Puppeteer: install the SDK, open and check a page, manage baselines, configure grid coverage, and clean up tests.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install Applitools’ Puppeteer SDK, open an Eyes test around a Puppeteer page, capture one or more visual checkpoints, then close the test and collect its results. The documented package is @applitools/eyes-puppeteer; Applitools’ example tutorial was published February 6, 2024, so check the current package documentation and the version in your project before relying on its exact APIs.

Install the Puppeteer integration

Applitools’ Puppeteer tutorial installs the integration as a development dependency:

As an Amazon Associate I earn from qualifying purchases.

npm i -D @applitools/eyes-puppeteer

The package provides the Eyes integration for Puppeteer. The tutorial uses ES module imports. Its API example is documented by Applitools, not independently validated here against every current package release; confirm compatibility with the version you install.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure Eyes and the visual test

An Eyes test has three essential phases: open a test for a Puppeteer page, make visual checks, and close it so the results can be collected. Applitools describes this lifecycle as opening Eyes, performing validations, and closing Eyes. See its Puppeteer tutorial for the dated example and its system overview for the comparison flow.

The tutorial’s example imports Eyes, Target, and VisualGridRunner from the package. It also imports BrowserType and DeviceName when configuring Ultrafast Grid targets. Use an API key supplied through the environment rather than committing it in source code.

import { Eyes, Target, VisualGridRunner } from '@applitools/eyes-puppeteer';

const apiKey = process.env.APPLITOOLS_API_KEY;
if (!apiKey) throw new Error('Set APPLITOOLS_API_KEY before running visual tests');

const visualGridRunner = new VisualGridRunner();
const eyes = new Eyes(visualGridRunner);

eyes.setApiKey(apiKey);
const configuration = eyes.getConfiguration();
configuration.setBatch('Puppeteer visual tests');
eyes.setConfiguration(configuration);

This shows the setup pattern from the tutorial. Its full configuration example also adds browser and device targets to the configuration; the target list should reflect the browsers and devices your suite needs to cover. For the precise exports and supported target names in your installed SDK version, consult the current package documentation.

Open Eyes on a Puppeteer page and capture checkpoints

Create the Puppeteer browser and page as your suite normally does, then open Eyes against that page. Supply an application name and a stable test name so later runs can be associated with the intended visual test.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await eyes.open(page, {
  appName: 'Storefront',
  testName: 'Product page'
});

await page.goto('https://example.com/products/widget');
await eyes.check('Product page loaded', Target.window());
await eyes.closeAsync();

The example illustrates the lifecycle and a window checkpoint; it is not a full test runner or a substitute for your project’s setup and cleanup. In the tutorial, the page is prepared and its checkpoint is invoked as part of the test flow. Place checks after the application has reached a meaningful, stable state—for example, after navigation and any required data or interaction are complete.

Choose the checkpoint scope

A window target captures the visible viewport by default. The Applitools example also demonstrates requesting full-page capture with Target.window().fully():

await eyes.check('Entire product page', Target.window().fully());

Use a viewport check when the visible screen is the behavior you need to protect. Choose full-page capture when below-the-fold content matters, bearing in mind that page length and dynamic content affect what is included.

Choose checkpoint placement

The tutorial extends PuppeteerRunnerExtension and calls eyes.check(...) from an afterEachStep hook, which captures after each replay step. That is one documented pattern, particularly for Recorder-driven flows. In a custom suite, checkpoints can instead be placed at intentional stable states; the important point is that each check captures the state you mean to compare.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run locally or add browser and device coverage

You can use Eyes with your Puppeteer page and configure the visual grid for additional browser or device targets. The tutorial creates a VisualGridRunner and adds browser/device configurations through the Eyes configuration. This separates the browser that drives the Puppeteer test from the set of environments used for visual comparison. Consult current Applitools documentation for available target identifiers and SDK compatibility.

Broader target coverage can expose rendering differences that a single local browser will not show, but it also means more comparison results to review. Start with targets that correspond to supported user environments rather than adding configurations without a testing reason.

Rank #4
The Web Testing Handbook
  • Used Book in Good Condition

Close Eyes safely and collect results

Close the Puppeteer browser and close the Eyes test even when an assertion or page action fails. The tutorial uses closeAsync() to finish a test, abortAsync() as a safeguard, and getAllTestResults() to collect summaries from the visual grid runner. An Eyes test left open can keep running.

let eyesClosed = false;
try {
  await eyes.open(page, { appName: 'Storefront', testName: 'Product page' });
  await page.goto('https://example.com/products/widget');
  await eyes.check('Product page loaded', Target.window());
  await eyes.closeAsync();
  eyesClosed = true;
} finally {
  await browser.close();
  if (!eyesClosed) await eyes.abortAsync();
}

const results = await visualGridRunner.getAllTestResults();
console.log(results);

Use cleanup appropriate to your runner and SDK version; the snippet shows the documented close/abort distinction, not a complete policy for handling every possible error during shutdown. Review the returned results in Applitools’ tooling, where visual differences can be inspected against the saved baseline.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Understand baselines and visual differences

The first run for a test establishes the expected image baseline; subsequent runs compare their captured checkpoints with it. Baselines can differ by environment. The tutorial identifies operating system, viewport, browser, application name, and test name among the parameters relevant to environments and baselines.

A detected visual difference is a signal to review, not proof by itself that the application is broken. Inspect the changed regions in the Test Manager. If the change is an intended UI update, accept the new appearance only after verifying it; if it is unintended, fix the application or test setup rather than updating the baseline to hide it. Applitools’ system overview explains that the SDK sends screenshots to the Eyes Server for comparison and that testers review differences in Test Manager.

Common problems and fixes

  • Missing API key: The tutorial’s setup expects APPLITOOLS_API_KEY. Define it in the test environment or secret store, and fail early if it is absent; do not commit the key.
  • Imports or methods do not match: The tutorial dates to February 6, 2024. Check the installed @applitools/eyes-puppeteer version and its current documentation before copying version-specific imports, configuration methods, or target enums.
  • No useful checkpoint appears: Confirm that eyes.open receives the Puppeteer page and that eyes.check runs after navigation and required interactions. Choose viewport or full-page scope intentionally.
  • Test appears to keep running: Ensure every opened Eyes test reaches closeAsync() on success and the applicable abort cleanup on failure. Also await collection of results from the runner.
  • Unexpected differences recur: Check whether the page state is stable and whether the run is being compared under the intended browser, viewport, operating system, and named test configuration before accepting a changed baseline.

Or skip the browser setup

If your goal is simply to capture a website screenshot by API, ScreenshotNeo offers a one-request alternative. It is a screenshot API and MCP server; it is not an Applitools visual-baseline replacement.

Example using cURL: see the ScreenshotNeo documentation for API details.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes known cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, and cache hits are not billed. Its MCP server lets AI agents take screenshots, and the Free plan includes 1,000 screenshots a month without a card; paid plans start at $5 for 3,000. Sign up free for 1,000 screenshots a month with no card.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.