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 🙏

© 2024 – Pkg Stats / Ryan Hefner

scalewright

v1.37.1-1

Published

![Scalewright](./scalewright-header.png)

Downloads

1

Readme

Scalewright

Scalewright

This project aims to provide a number of features which are useful to teams that have large Playwright test suites and run Playwright at scale.

  • Performance testing and measurement. Use existing Playwright test suites to measure and report Core Web Vitals of your web apps.
  • Monitoring & observability. Connect your Playwright tests to CloudWatch, Datadog, Honeycomb, Lightstep, and more. You can then create dashboards and visualize trends. Coming soon
  • Drop-in, no code changes required. Scalewright is designed to just work and require minimal extra configuration.
  • Parallelize at scale. Parallelize and run test suites faster on AWS Lambda. Coming soon

Note: This project is brought to you by Artillery. This project is not affiliated with the Playwright team or Microsoft. We're sharing something we built with other power users of Playwright to help them do even more with Playwright.

Performance Testing

Description

This lets you use your Playwright test suites for performance testing and measurement.

Scalewright extends Playwright with automatic tracking of Web Vitals. The following metrics will be tracked by all page actions in every test block:

  • LCP
  • FID
  • CLS
  • FCP
  • TTFB

Learn more about Web Vitals on https://web.dev/vitals/

Getting Started

You can enable performance testing in two ways:

  1. Automatic instrumentation with @scalewright/test in your imports
  2. Manual instrumentation with @scalewright/performance-tracking

Method 1: automatic instrumentation with @scalewright/test

This method requires updating only a single line of code in your test suite.

Install @scalewright/test alongside Playwright (i.e. usually as a devDependency in a Node.js project):

npm install -D @scalewright/test

And then replace @playwright/test with scalewright/test in your imports:

// Before:
// import { test, expect } from '@playwright/test';

// After:
import { test, expect } from '@scalewright/test';

// Continue using the "test" helper as normal.
test('has title', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await expect(page).toHaveTitle(/Playwright/);
});

That's it. That will extend the built-in page fixture under the hood (using the official Playwright fixture override API). Everything else is simply re-exported from @playwright/test so things like expect work as normal.

Method 2: use @scalewright/performance-tracking directly

If you can't replace the imports for some reason, you can extend the page fixture yourself.

Install alongside Playwright (i.e. usually as a devDependency in a Node.js project):

npm install -D @scalewright/performance-tracking

And then extend the built-in page fixture (uses Playwright's official fixture override API under the hood):

// Import Playwright Test runner's "test" helper as a different name so that
// we can extend it:
import { test as base, expect } from '@playwright/test';

// Extend it to track performance tracking and leaving everything else as-is:
import { withPerformanceTracking } from '@scalewright/performance-tracking';
const test = withPerformanceTracking(base);

// Use the "test" helper as normal
test('has title', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await expect(page).toHaveTitle(/Playwright/);
});

This will need to be done in every file that uses Playwright Test Runner.

Monitoring & Observability

This connects your Playwright tests to external monitoring/observability systems (such as Datadog, CloudWatch, Honeycomb or any other provider that supports StasD or OpenTelemetry protocols). Test metrics, traces, and events can then be sent over for visibility and analysis.

Coming soon - get notified for updates

Parallelize at scale

Scale out your Playwright test suite on AWS Lambda for a massive speed up and reduction in running time. This requires no DevOps or infra work - a serverless "grid" is created on the fly in your own AWS account. This is orders of magnitude cheaper than cloud hosted platforms for running large Playwright tests.

Coming soon - get notified for updates

Get notified for updates

The best way to be notified is to Watch releases and discussions on the repo:

Watch the repo

Versioning

This project will aim to follow the release schedule of Playwright.

Each release will be versioned as follows: major.minor.patch-n where major.minor.patch will match a specific version of Playwright, and n is a release number of Scalewright itself. To illustrate it with an example:

  1. Playwright release version 1.37.1
  2. Scalewright version 1.37.1-0 is published. The 1.37.1 part tells you which release of Playwright this version of Scalewright works with. -0 means it's the first release of Scalewright for Playwright v1.37.1.
  3. A user reports a bug in Scalewright, we fix it and publish Scalewright v1.37.1-1. This is now the latest release of Scalewright that is intended to work with Playwright v1.37.1.

License

Apache 2.0 (same as Playwright)