Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@applitools/eyes-playwright

Package Overview
Dependencies
Maintainers
57
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@applitools/eyes-playwright

Applitools Eyes SDK for Playwright

  • 1.34.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
110K
decreased by-12.36%
Maintainers
57
Weekly downloads
 
Created

What is @applitools/eyes-playwright?

@applitools/eyes-playwright is a package that integrates Applitools' visual testing capabilities with Playwright, a popular browser automation library. It allows developers to perform visual testing and cross-browser testing to ensure that web applications render correctly across different devices and browsers.

What are @applitools/eyes-playwright's main functionalities?

Visual Testing

This feature allows you to perform visual testing by capturing screenshots of web pages and comparing them against a baseline to detect visual differences. The code sample demonstrates how to integrate Applitools Eyes with Playwright to perform a visual check on a webpage.

const { chromium } = require('playwright');
const { Eyes, Target } = require('@applitools/eyes-playwright');

(async () => {
  const browser = await chromium.launch();
  const page = await browser.newPage();
  const eyes = new Eyes();

  try {
    await eyes.open(page, 'Demo App', 'Smoke Test');
    await page.goto('https://example.com');
    await eyes.check('Main Page', Target.window());
    await eyes.close();
  } finally {
    await browser.close();
    await eyes.abortIfNotClosed();
  }
})();

Cross-Browser Testing

This feature enables cross-browser testing by running visual tests across different browsers such as Chromium, Firefox, and WebKit. The code sample shows how to iterate over multiple browser types to perform visual checks on each.

const { chromium, firefox, webkit } = require('playwright');
const { Eyes, Target } = require('@applitools/eyes-playwright');

(async () => {
  const browsers = [chromium, firefox, webkit];
  for (const browserType of browsers) {
    const browser = await browserType.launch();
    const page = await browser.newPage();
    const eyes = new Eyes();

    try {
      await eyes.open(page, 'Demo App', `Cross-Browser Test - ${browserType.name()}`);
      await page.goto('https://example.com');
      await eyes.check('Main Page', Target.window());
      await eyes.close();
    } finally {
      await browser.close();
      await eyes.abortIfNotClosed();
    }
  }
})();

Other packages similar to @applitools/eyes-playwright

Keywords

FAQs

Package last updated on 18 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc