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

@blaze-cms/plugin-testing-base

v0.3.0

Published

visual regression testing tools for blaze projects

Downloads

208

Readme

@blaze-cms/plugin-testing-base

Visual-regression helpers for Blaze frontends: full-page record and compare, with image masking, plus BrowserStack execution shared with @blaze-cms/plugin-testing-e2e.

Full-page record and compare

import { test, fullPageRecord, fullPageCompare } from '@blaze-cms/plugin-testing-base';

test('(record) home', async ({ page }, testInfo) => {
  await fullPageRecord({ page, testInfo, testIndex: 0, url: '/' });
});

Both settle the page first: navigate, remove .banner elements, scroll down in viewport steps to trigger lazy-loading, wait briefly for images, scroll back up and wait for network idle. Every wait has a ceiling enforced from the test runner, not by a timer inside the page, so a page that never stops lazy-loading can't stall the test. Pass budget to change the ceilings; the defaults are in DEFAULT_SETTLE:

await fullPageCompare({ page, testInfo, testIndex, url, budget: { totalMs: 90_000 } });

Pass mask to hide more elements than the built-in image masks, such as a widget whose content rotates on every load:

await fullPageCompare({ page, testInfo, testIndex, url, mask: ['.card--numbered-list'] });

The settle refuses to capture an error page: a response of 400 or above, other than 404, fails the test instead of becoming a baseline. That catches WAF blocks (403) and missing basic auth (401).

Upgrading from 0.2 or earlier changes how pages settle, so re-record baselines after upgrading.

BrowserStack

BrowserStack is on by default: runs go there whenever BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY are set. BLAZE_TEST_BROWSERSTACK=false forces local browsers, and =true makes missing credentials an error. In the Playwright config:

import { browserStackVR } from '@blaze-cms/plugin-testing-base';

const browserStack = browserStackVR({ site: 'mysite', storageState: cookiesStoreFile });

export default defineConfig({
  projects: browserStack.enabled ? browserStack.projects : localProjects(),
  workers: browserStack.workers ?? 2,
  // ...
});

Import test from this package rather than @playwright/test. It carries the fixtures that open real Android and iOS devices and mark BrowserStack sessions passed or failed.

BLAZE_TEST_PLAYWRIGHT_PLATFORM_COVERAGE takes the visual-regression names or the e2e package's names:

| Coverage | BrowserStack platforms | |---|---| | chrome-only / chromium (default) | Chrome / Windows 11 | | core | Chrome / Windows 11, Safari 26 / macOS, real Galaxy S25 | | desktop-only / desktop | Chrome, Edge, Firefox / Windows 11; Chrome / macOS; Safari 18 and 26 / macOS | | mobile-only / mobile | Real Android phones and tablets | | cross-breakpoint | Chrome / Windows 11 plus the real Galaxy Tab | | all | Everything |

BLAZE_TEST_BROWSERSTACK_PLATFORMS picks platform keys directly. The platform list and the other BLAZE_TEST_BROWSERSTACK_* settings are documented in the @blaze-cms/plugin-testing-e2e README.

Things to know:

  • Baselines don't cross modes. Screenshots depend on the OS, fonts and device, so record and compare in the same mode and on the same platforms.
  • Desktop platforms use a 1280x720 viewport to match local Desktop Chrome. Pass desktopViewport to change it.
  • Real devices keep their hardware viewport. snapshotWithMask doesn't resize them, and specs that call page.setViewportSize() skip on them.
  • Real iOS devices are left out of coverage-based selection for now. On 2026-10-01 the context opened but creating the page timed out on BrowserStack's side under a visual-regression config, while e2e suites ran on the same devices. Name them in BLAZE_TEST_BROWSERSTACK_PLATFORMS to try them. They also run without request routes or extraHTTPHeaders, which BrowserStack can't support there.
  • mobile-only and core therefore mean Android and desktop until iOS is resolved: core is Chrome, Safari 26 on macOS and a real Galaxy S25.