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

@computerwwwizards/screenplay-storybook

v0.1.0

Published

Lightweight Screenplay Pattern DSL (Actor/Ability/Question/Performable) targeting Storybook interaction tests.

Downloads

107

Readme

@computerwwwizards/screenplay-storybook

A lightweight implementation of the Screenplay Pattern (Actor, Ability, Performable, Question) for writing Storybook interaction tests. It wraps storybook/test's userEvent/canvas behind DOM-aware PageElement/By locators and a library of interactions (Click, Enter, Hover, ...) and assertions (Ensure, equals, isVisible, ...), so play functions read as user intent instead of raw DOM calls.

Installation

npm install @computerwwwizards/screenplay-storybook storybook

storybook is a peer dependency — install whichever version of Storybook (^10.5.6) your project already uses.

Examples

Inside a Storybook story's play function:

import {
  Actor,
  BrowseWithStorybook,
  By,
  PageElement,
  Click,
  Enter,
  Ensure,
  Text,
  equals,
} from '@computerwwwizards/screenplay-storybook';

export const play = async ({ canvas, userEvent, canvasElement }) => {
  const actor = Actor.named('Alice').whoCan(
    BrowseWithStorybook.using({ userEvent, canvas, canvasElement })
  );

  const usernameInput = PageElement.located(By.role('textbox'));
  const submitButton = PageElement.located(By.role('button'));
  const result = PageElement.located(By.testId('result'));

  await actor.attemptsTo(
    Enter.theValue('alice').into(usernameInput),
    Click.on(submitButton),
    Ensure.that(Text.of(result), equals('Welcome, alice!'))
  );
};

Actor.attemptsTo(...) runs a sequence of Performables; Ensure.that(question, expectation) resolves a Question (like Text.of(...)) and asserts it against an Expectation (like equals(...), isVisible(), contains(...)). By supports css, id, role, text, labelText, placeholderText, and testId locators, each usable both against a plain DOM container and against Testing-Library-style canvas queries.

Troubleshooting

  • Error: Actor <name> does not have the Ability to BrowseWithStorybook — the actor was never given .whoCan(BrowseWithStorybook.using({...})). Every actor that resolves PageElement/PageElements or runs DOM interactions needs this ability.
  • Unable to locate element described by ... — the By locator didn't match anything in canvasElement (or via canvas, when provided). Double check the locator against the rendered story markup.
  • Wait.upTo(...).until(...) throws Timeout of Nms exceeded — the polled Question/Expectation never became true within the timeout; increase the duration via Wait.upTo(Duration.ofSeconds(n)) or verify the expected state is actually reachable.

Changelog

See CHANGELOG.md (generated by Changesets on release).

Additional resources

License information

MIT © computerwwwizards