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

auto-heal-utility

v1.0.3

Published

A Playwright utility for auto-healing broken locators.

Readme

Auto-Healer Utility for Playwright

This utility provides a way to auto-heal broken locators in your Playwright tests. It works by logging locator failures and then using that data to intelligently select the best locator from a list of alternatives.

Installation

npm install auto-healer-utility

Usage

import { WaitHelper } from 'auto-healer-utility';
import { test } from '@playwright/test';

test('my test', async ({ page }) => {
  const waitHelper = new WaitHelper(page);

  // Use the waitHelper to interact with elements
  await waitHelper.waitForElementAndClick([page.locator('#button1'), page.locator('#button2')], {
    feature: 'my feature',
    scenario: 'my scenario',
    step: 'click button',
  });
});

How it Works

The WaitHelper class is the main entry point for the utility. It takes a Playwright Page object in its constructor. The waitForElementAndClick and waitForElementAndFill methods take an array of locators and a metadata object. The metadata object is used to log information about the test that is running.

The AutoHeal class is responsible for the core auto-healing logic. It works by:

  1. Logging failures: When a locator fails, the AutoHeal class logs the failure to a file. The log entry includes the locator, the reason for the failure, and the metadata.
  2. Analyzing logs: The AutoHeal class analyzes the log file to determine which locators are the most reliable. It does this by counting the number of times each locator has failed.
  3. Selecting the best locator: When you call waitForElementAndClick or waitForElementAndFill, the AutoHeal class selects the best locator from the array of locators that you provide. It does this by selecting the locator that has failed the least number of times.

Configuration

The AutoHeal class can be configured with the following options:

  • timeout: The timeout in milliseconds to wait for a locator to be attached to the DOM. Defaults to 60 seconds.
  • logFile: The path to the log file. Defaults to logs/locator_failures.log.