CI: Add internal Storybook E2E job#35052
Conversation
Wire Playwright tests against code/.storybook into CircleCI so we have a stable home for internal UI regressions, starting with a minimal smoke test on a core template story. Co-authored-by: Cursor <cursoragent@cursor.com>
Clarifies that Playwright specs under e2e-sandbox target generated sandboxes, distinct from e2e-internal for the internal Storybook UI. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a new CircleCI job to run Playwright E2E smoke coverage against the repo’s internal Storybook UI (code/.storybook) by introducing an e2e-tests-internal task and a minimal internal UI spec suite.
Changes:
- Added a new
e2e-tests-internaltask that waits for the internal UI and runs Playwright with JUnit output support. - Introduced a new
code/e2e-internal/Playwright smoke spec and a corresponding Playwright “project”. - Wired a new “Internal storybook E2E” job into the generated CircleCI workflow and excluded
e2e-internalfrom unit/story test file globbing.
Reviewed changes
Copilot reviewed 16 out of 40 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/tasks/e2e-tests-internal.ts |
New task to run Playwright against the internal Storybook UI after it’s available. |
scripts/task.ts |
Registers the new task and marks it as non-sandbox-scoped. |
scripts/ci/main.ts |
Adds the new CI job to the generated workflow config. |
scripts/ci/common-jobs.ts |
Defines the new CircleCI job and excludes e2e-internal from unit/story globbing. |
code/playwright.config.ts |
Adds a new Playwright project for internal Storybook tests. |
code/e2e-internal/internal-storybook.smoke.spec.ts |
Minimal smoke test to assert the internal preview iframe renders a known story. |
code/.eslintrc.js |
Applies Playwright ESLint rules to the new internal E2E specs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds an internal Storybook Playwright smoke test suite with supporting CI infrastructure. The test verifies the internal Storybook preview iframe renders correctly. Changes include new test specs, Playwright configs, a CLI task, CircleCI job integration, updated test globs, and helper import migrations across portable-stories test files to use the consolidated e2e-sandbox utility path. ChangesInternal Storybook E2E Testing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/tasks/e2e-tests-internal.ts`:
- Around line 15-23: The run method currently calls waitOn() unconditionally
which blocks when --dry-run is used; modify the async run({ codeDir,
junitFilename }, { dryRun, debug }) function to skip the waitOn call (and any
dependent Storybook readiness logic that follows) when dryRun is true—i.e.,
check the dryRun flag before constructing storybookUrl/await waitOn(...) and
return or proceed without waiting so the task exits immediately in dry-run mode.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 27159251-8cc1-4cd4-93b5-2c32cc3a4cf1
📒 Files selected for processing (7)
code/.eslintrc.jscode/e2e-internal/internal-storybook.smoke.spec.tscode/playwright.config.tsscripts/ci/common-jobs.tsscripts/ci/main.tsscripts/task.tsscripts/tasks/e2e-tests-internal.ts
Only register the internal-storybook project when STORYBOOK_INTERNAL_E2E is set by the e2e-tests-internal task, so sandbox e2e runs are unchanged. Shorten readiness wait to 25s and skip waitOn during dry-run. Co-authored-by: Norbert de Langen <norbert@chromatic.com>
Use playwright.internal.config.ts for e2e-internal so sandbox e2e keeps a single sandbox-only playwright.config.ts without env gating. Co-authored-by: Norbert de Langen <norbert@chromatic.com>
Colocate playwright.config.ts with internal UI e2e specs instead of the code package root. Co-authored-by: Norbert de Langen <norbert@chromatic.com>
Internal Playwright config is dedicated to e2e-internal, so a single default project is enough. Co-authored-by: Norbert de Langen <norbert@chromatic.com>
JReinhold
left a comment
There was a problem hiding this comment.
A few comments, nothing blocking.
Use top-level testDir in sandbox playwright.config.ts again now that internal e2e has its own config. List e2e-internal in CONTRIBUTING.md repo overview. Co-authored-by: Norbert de Langen <norbert@chromatic.com>
Closes #
What I did
This PR adds end-to-end test infrastructure for the internal Storybook UI (
code/.storybook) and renames the existing sandbox Playwright suite directory for clarity.Why
Today, Playwright coverage runs almost exclusively against generated sandboxes via the
e2e-tests/e2e-tests-devtasks. The internal Storybook we use for core/manager/addon development (yarn storybook:ui) has no equivalent CI gate. That makes it easy to regress internal-only demos (open-service examples, manager stories, etc.) without noticing until someone runs the UI locally.We want a stable, documented place for internal UI regressions before landing feature-specific tests on other branches.
Why this approach
Two directories, two Playwright projects
code/e2e-sandbox/— specs for sandbox templates (renamed frome2e-tests/)code/e2e-internal/— specs forcode/.storybooke2e-testsande2e-tests-devare unchanged (they still mean “run sandbox E2E”).New
e2e-tests-internaltask (non-sandbox)scripts/task.tsand excluded fromisSandboxTask, so it does not require a--template.http://localhost:6006/index.json, then runsplaywright test --project=internal-storybook.Minimal smoke test only
internal-storybook.smoke.spec.tsloads a stable core template story (core-basics--basic) and asserts the preview renders.next.Playwright config
testDir; each project sets its own (e2e-sandboxforsetup/chromium,e2e-internalforinternal-storybook).CI
yarn storybook:ui(background) → port 6006 →yarn task e2e-tests-internal.e2e-sandbox/ande2e-internal/(Playwright specs are not Vitest tests).Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Internal Storybook E2E (new path)
yarn nx compile core(oryarn task compile --no-link) ifcode/core/distis stale.cd code && yarn storybook:ui— wait until Storybook is listening on port 6006.yarn task e2e-tests-internal --no-link -s e2e-tests-internalcode/:yarn playwright test --project=internal-storybookcore-basics--basicand finds theClick Me!button in the preview iframe.Sandbox E2E rename (regression check)
yarn task e2e-tests-dev --template react-vite/default-ts --start-from autocd code && STORYBOOK_URL=… yarn playwright test --project=chromium e2e-sandbox/navigation.spec.tswith a sandbox already served.CI
No product behavior changes are expected beyond test/CI wiring; manual UI spot-check of
yarn storybook:uiis optional.Documentation
CONTRIBUTING.mdandCODEOWNERSpaths were updated fore2e-sandbox/. No user-facing migration: task CLI names are unchanged.Checklist for Maintainers
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsqa:neededorqa:skipSuggested label:
build(CI/test tooling only; no runtime Storybook behavior change).🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>Summary by CodeRabbit
New Features
Tests
Documentation