This document covers how to run the various test suites in the ForgeRock Web Login Framework.
Unit tests use Vitest and live alongside the source code in packages/login-widget.
# Run tests in watch mode
pnpm test
# Run tests once (CI mode)
pnpm test -- --runStorybook interaction tests verify component behavior in an isolated environment.
# Build Storybook
pnpm build:storybook
# Run Storybook interaction tests (requires Storybook to be running)
pnpm storybook # Start Storybook on port 6006
pnpm test:storybook # Run interaction tests against running StorybookEnd-to-end tests use Playwright and live in the e2e/ workspace. See e2e/README.md for detailed documentation.
Before running E2E tests, you must:
- Build the widget:
pnpm build:widget - Build the login-app:
pnpm build:app - Install Playwright browsers:
pnpm exec playwright install chromium
# Run all E2E tests
pnpm ci:e2e
# Run with debug mode (opens browser inspector)
pnpm --filter @forgerock/login-widget-e2e run ci:e2e:debug
# Run a specific test file
pnpm ci:e2e -- tests/widget/modal/widget-modal.login.test.js
# Run with visible browser
pnpm ci:e2e -- --headedE2E tests require ForgeRock AM connection details. Set these in your environment or a .env file:
| Variable | Description |
|---|---|
VITE_FR_AM_URL |
ForgeRock AM base URL |
VITE_FR_AM_COOKIE_NAME |
AM session cookie name |
VITE_FR_OAUTH_PUBLIC_CLIENT |
OAuth 2.0 client ID |
VITE_FR_REALM_PATH |
AM realm path |
FR_AM_WELLKNOWN_URL |
AM wellknown URL |
# Run Prettier + ESLint with auto-fix
pnpm check:lint
# Run Svelte type checking
pnpm check:svelteThe CI pipeline (.github/workflows/ci.yml) runs the following jobs on every push:
| Job | Description |
|---|---|
| build | Builds the widget release artifacts |
| test-lint-storybook-build | Runs linting, unit tests, Storybook build, and Storybook interaction tests |
| e2e | Runs Playwright tests across macOS + Ubuntu with 4-shard parallelism |
| merge-e2e-report | Merges sharded E2E reports into a single HTML report |
| chromatic | Runs Chromatic visual regression tests |
© Copyright 2022-2025 Ping Identity Corporation. All Rights Reserved.