npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anguske/mcp-playwright-visual-test

v1.0.11

Published

UI Visual Comparison Testing tool - visual regression testing tool based on Playwright

Downloads

53

Readme

@anguske/playwright-visual-test

A visual regression testing tool based on Playwright, supporting UI screenshot comparison and automated testing.

Installation

npm install @anguske/playwright-visual-test
# or
yarn add @anguske/playwright-visual-test
# or
pnpm add @anguske/playwright-visual-test

Features

  • Support for multiple viewport size testing
  • Configurable comparison threshold
  • Support for ignoring dynamic content areas
  • Automatic comparison report generation
  • Integration with MCP protocol

API Documentation

runTest(options)

Main test function, accepts the following parameters:

  • url: Target page URL
  • viewport: Viewport size configuration { width: number, height: number }
  • waitForSelector?: Optional, wait for specific element to appear
  • ignoreSelectors?: Optional, array of selectors to ignore
  • threshold?: Optional, pixel comparison threshold (0-1)

License

MIT

MCP Playwright Visual Test Tool Configuration Guide

In mcp.json, you can configure the Playwright visual test tool as follows:

{
  "mcp-playwright": {
    "command": "npx",
    "args": [
      "-y",
      "@anguske/mcp-playwright-visual-test"
    ],
    "env": {
      // Auto login configuration
      "AUTO_LOGIN_USERNAME": "your-username",
      "AUTO_LOGIN_PASSWORD": "your-password",
      "AUTO_LOGIN_USERNAME_SELECTOR": "#userNameSignIn",
      "AUTO_LOGIN_PASSWORD_SELECTOR": "#passwordSignIn",
      "AUTO_LOGIN_SUBMIT_SELECTOR": "input[type=\"submit\"]",
      "AUTO_LOGIN_SUCCESS_SELECTOR": "", // Optional, element selector after successful login
      "AUTO_LOGIN_URL_PATTERN": "login|signin|auth", // Login page URL match pattern

      // Visual test configuration
      "TEST_SELECTOR": "", // Optional, selector for element to screenshot
      "TEST_WAIT_FOR_SELECTOR": "", // Optional, wait for specific element
      "TEST_WAIT_TIMEOUT": 10000, // Optional, wait timeout in milliseconds
      "TEST_THRESHOLD": 20, // Optional, pixel comparison threshold (0-100)
      "TEST_IGNORE_SELECTORS": ".dynamic-content,.ads", // Optional, selectors to ignore, comma separated
      "TEST_VIEWPORT_WIDTH": 1440, // Optional, viewport width, default 1280
      "TEST_VIEWPORT_HEIGHT": 800, // Optional, viewport height, default 720

      // Project configuration
      "PROJECT_ROOT": "D:/myProject/quickstart-resources/weather-server-typescript" // Project root path
    }
  }
}

Configuration Details

Auto Login Configuration

  • AUTO_LOGIN_USERNAME: Login username
  • AUTO_LOGIN_PASSWORD: Login password
  • AUTO_LOGIN_USERNAME_SELECTOR: Username input field selector
  • AUTO_LOGIN_PASSWORD_SELECTOR: Password input field selector
  • AUTO_LOGIN_SUBMIT_SELECTOR: Login button selector
  • AUTO_LOGIN_SUCCESS_SELECTOR: Element selector after successful login (optional)
  • AUTO_LOGIN_URL_PATTERN: Login page URL match pattern for auto-detecting login page redirects

Visual Test Configuration

  • TEST_SELECTOR: Selector for element to screenshot, captures entire page if not set
  • TEST_WAIT_FOR_SELECTOR: Wait for specific element before taking screenshot
  • TEST_WAIT_TIMEOUT: Timeout for waiting for element (milliseconds)
  • TEST_THRESHOLD: Pixel difference threshold for image comparison (0-100), default 100
  • TEST_IGNORE_SELECTORS: List of selectors to ignore during comparison, comma separated
  • TEST_VIEWPORT_WIDTH: Browser viewport width, default 1280
  • TEST_VIEWPORT_HEIGHT: Browser viewport height, default 720

Project Configuration

  • PROJECT_ROOT: Absolute path to project root directory for storing screenshots and files

Notes

  1. All configuration items are optional, but it's recommended to configure essential login information and viewport size
  2. Screenshots will be saved in the screenshots folder in the project root directory
  3. Comparison results will generate three files:
    • current.png: Current test screenshot
    • baseline.png: Baseline screenshot
    • diff.png: Difference comparison image
  4. On first run, the current screenshot will automatically be set as the baseline image