Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
preset
✓ import preset from '@storycap-testrun/node/preset';
✗ import { preset } from 'storycap-testrun';
The `preset` configuration for `@storybook/test-runner` is provided by the `@storycap-testrun/node` package since v2.0.0, not directly from the root `storycap-testrun` package.
VitestPlugin
✓ import { createVitestPlugin } from '@storycap-testrun/browser/vitest-plugin';
✗ import { VitestPlugin } from 'storycap-testrun';
For Vitest integration, the `createVitestPlugin` function is exported specifically from the `/vitest-plugin` entry point of `@storycap-testrun/browser` since v2.0.0.
Demonstrates how to configure `@storybook/test-runner` with `@storycap-testrun/node`'s preset for stable screenshot capture. It also hints at per-story options.
// .storybook/test-runner-jest.config.js (or similar Jest/Playwright configuration)
import { defineConfig } from 'jest-runner-storybook';
import preset from '@storycap-testrun/node/preset';
export default defineConfig({
...preset(),
// You can customize Playwright launch options here
// playwright: {
// launchOptions: {
// headless: true,
// },
// },
// Add any other custom Jest configuration
testTimeout: 30000,
});
// Example .storybook/preview.js for per-story options (requires @storycap-testrun/node@2.1.0+)
// import type { Preview } from '@storybook/react';
// const preview: Preview = {
// parameters: {
// screenshot: {
// fullPage: false,
// omitBackground: true,
// scale: 1,
// },
// },
// };
// export default preview;
Debug
Known issues
breakingThe `storycap-testrun` package (version 1.0.0) dropped support for Node.js 18. The minimum required Node.js version is now 20.fixUpgrade your Node.js environment to version 20 or higher.
affects: 1.0.0
gotchaStarting from version 2.0.0, the core functionality and new features are primarily delivered through scoped packages: `@storycap-testrun/node` and `@storycap-testrun/browser`. The root `storycap-testrun` package at 1.0.0 may not include these newer features or configurations directly.fixEnsure you are installing and importing from `@storycap-testrun/node` or `@storycap-testrun/browser` for the latest features and configurations. Refer to their respective documentation.
affects: >=2.0.0 (for scoped packages)
gotchaPer-story image options (`fullPage`, `omitBackground`, `scale`) for screenshot capture were introduced in `@storycap-testrun/node` and `@storycap-testrun/browser` at version 2.1.0. These options are set via `parameters.screenshot` in your Storybook stories or `preview.js`.fixUpdate `@storycap-testrun/node` or `@storycap-testrun/browser` to version 2.1.0 or newer to utilize per-story screenshot parameters. Configure them in `parameters.screenshot` within your stories or `preview.js`.
affects: >=2.1.0 (for scoped packages)
gotchaSupport for `@storybook/addon-vitest` and a new Vitest plugin were added in `@storycap-testrun/browser` at version 2.0.0, accessible via the `/vitest-plugin` export.fixTo enable visual testing with Vitest, install `@storycap-testrun/browser` v2.0.0+ and use the `createVitestPlugin` from `'@storycap-testrun/browser/vitest-plugin'` in your Vitest configuration.
affects: >=2.0.0 (for @storycap-testrun/browser)
Errors
Common errors & fixes
ERR_OS_NOT_SUPPORTED: The current operating system is not supported.
Playwright, a peer dependency, has specific OS requirements or native binaries might not be installed correctly.
fixEnsure your environment meets Playwright's system requirements. Run `npx playwright install` to download necessary browser binaries if they are missing or corrupted.
Error: Node.js v18.x is not supported. Please upgrade to Node.js v20.x or higher.
Using `storycap-testrun@1.0.0` or newer with an unsupported Node.js version.
fixUpgrade your Node.js environment to version 20 or higher. You can use a version manager like `nvm` (Node Version Manager) or `volta`.
TypeError: (0 , storycap_testrun_1.preset) is not a function
Attempting to import `preset` directly from `storycap-testrun` (the root package) when it's now exported from `@storycap-testrun/node/preset` in versions 2.0.0+ of the scoped packages, or `storycap-testrun@1.0.0` never directly exported it.
fixChange your import statement to `import preset from '@storycap-testrun/node/preset';` and ensure `@storycap-testrun/node` is installed and at version 2.0.0 or higher.
Audit
Dependencies
@storybook/test-runnerrequiredCore dependency for integrating screenshot capture into Storybook's test runner workflow.
playwrightrequiredUnderlying browser automation tool used for capturing screenshots.