Skip to content

Conversation

@ndelangen
Copy link
Member

Closes #

What I did

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 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/core team 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>

…and improve visibility checks for UI elements in e2e tests.
@ndelangen ndelangen self-assigned this Nov 21, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2025

Fails
🚫 PR title must be in the format of "Area: Summary", With both Area and Summary starting with a capital letter Good examples: - "Docs: Describe Canvas Doc Block" - "Svelte: Support Svelte v4" Bad examples: - "add new api docs" - "fix: Svelte 4 support" - "Vue: improve docs"

Generated by 🚫 dangerJS against 4e32302

@ndelangen ndelangen added build Internal-facing build tooling & test updates ci:normal addon: vitest labels Nov 21, 2025
@nx-cloud
Copy link

nx-cloud bot commented Nov 21, 2025

View your CI Pipeline Execution ↗ for commit 4e32302

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 44s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-28 12:14:28 UTC

@ndelangen
Copy link
Member Author

ndelangen commented Nov 21, 2025

Well, isn't it nice to see that the test is flaking on this PR, and we actually see why?

@yannbf @valentinpalkovic
Screenshot 2025-11-21 at 20 21 49

Full error:

Error: I THREW AN UNHANDLED ERROR!

This error originated in "/tmp/storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/stories/UnhandledErrors.stories.tsx". It doesn't mean the error was thrown inside the file itself, but while it was running.

The latest test that might've caused the error is "Unhandled Error". It might mean one of the following:

The error was thrown, while Vitest was running this test.
If the error occurred after the test had been completed, this was the last documented test before it was thrown.
Stacks:

/tmp/storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/stories/UnhandledErrors.stories.tsx:12:8 - throwError
/tmp/storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/stories/UnhandledErrors.stories.tsx:8:2 - throwError
Error: 
    at throwError (http://localhost:63315/tmp/storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/stories/UnhandledErrors.stories.tsx?import&browserv=1763744364193:10:9)
    at unhandledError (http://localhost:63315/tmp/storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/stories/UnhandledErrors.stories.tsx?import&browserv=1763744364193:7:3)

Error: I THREW AN UNHANDLED REJECTION!

This error originated in "/tmp/storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/stories/UnhandledErrors.stories.tsx". It doesn't mean the error was thrown inside the file itself, but while it was running.

The latest test that might've caused the error is "Success". It might mean one of the following:

The error was thrown, while Vitest was running this test.
If the error occurred after the test had been completed, this was the last documented test before it was thrown.
Stacks:

/tmp/storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/stories/UnhandledErrors.stories.tsx:12:8 - throwError
/tmp/storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/stories/UnhandledErrors.stories.tsx:4:2 - throwError
Error: 
    at throwError (http://localhost:63315/tmp/storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/stories/UnhandledErrors.stories.tsx?import&browserv=1763744364193:10:9)
    at unhandledRejection (http://localhost:63315/tmp/storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/stories/UnhandledErrors.stories.tsx?import&browserv=1763744364193:4:3)



Troubleshoot: [https://storybook.js.org/docs/writing-tests/integrations/vitest-addon/?renderer=react#what-happens-if-vitest-itself-has-an-error](link://https//storybook.js.org/docs/writing-tests/integrations/vitest-addon/?renderer=react#what-happens-if-vitest-itself-has-an-error)

Comment on lines 86 to 98
try {
/** Sometimes the vitest instance fails, but the error-content is only shown in a modal.
* We click the link so the modal opens and we can close it.
* Having it open shortly is enough to have it be in the playwright trace, for debugging purposes.
*/
const descriptionButton = page.locator("#testing-module-description a");
if (
await descriptionButton.isVisible({ timeout: 4000 }).catch(() => false)
) {
await descriptionButton.click({ timeout: 4000, force: true });
}

await page.getByLabel("Close modal").click();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@valentinpalkovic Is this better?

@storybook-app-bot
Copy link

storybook-app-bot bot commented Nov 25, 2025

Package Benchmarks

Commit: 4e32302, ran on 28 November 2025 at 12:01:14 UTC

No significant changes detected, all good. 👏

@ndelangen
Copy link
Member Author

@yannbf @valentinpalkovic I've iterated a bit more, and i think this is now in a state, where it improves the debug-ability, and does not cause new issues.

Screenshot 2025-11-28 at 12 53 10

Shall we merge this?

@valentinpalkovic valentinpalkovic merged commit 33cc93d into next Dec 1, 2025
65 of 66 checks passed
@valentinpalkovic valentinpalkovic deleted the norbert/add-debug-for-e2e branch December 1, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addon: vitest build Internal-facing build tooling & test updates ci:normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants