-
Notifications
You must be signed in to change notification settings - Fork 72
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] preVisit accesses the story store before the index is ready #442
Comments
Interestingly enough, this doesn't seem to happen with a production build since our CI is passing: https://github.com/open-formulieren/open-forms-sdk/actions/runs/8340149970/job/22823603724?pr=663 |
We have the same problem. If I add const config: TestRunnerConfig = {
async preVisit(page, story) {
await waitForPageReady(page);
}
} |
We have the same problem but adding await page.waitForLoadState("networkidle") when running locally and in our CI flow it does not seem to do anything (get the Edit: Figured out the discrepancy. In local storybook is running via |
I'm having the same issue, it happens when running storybook dev with the --ci flag (Without the CI flag, when the playground webpage is opened, this does not occur). This only seems to happen in one specific instance, which also relies on Apollo GraphQL client mocked provider and is overall more complex. Smaller standalone packages with simple components do not seem to have this issue, and the tests run successfully. For reference, this is the output from storybook info, using Vite:
|
Any updates on this? I am having the exact same problem. |
Same here! Same problem. I'm doing the same thing where I'm using preVisit to set the viewport in some of our tests. In development mode, we see these errors when using |
Same issue here in async postVisit(page, context) {
await waitForPageReady(page);
...
} |
any update on this? |
@yannbf Have you had a chance to take a look at this? |
Any update on this? I encountered the same issue too. |
With a very small set of stories, |
Any update on this? 🥺 |
Also encountering this. My code is using the recipe to set the viewport size as in this example from the docs. Changing to |
Encountering the same with vue components, one time the tests pass, the next time this error occurs, and in different stories every time. |
We faced the same issue after upgrading to Storybook v8. We set the viewport size in
|
Describe the bug
We have the test-runner.js implement with the
preVisit
to apply the different viewports when running tests, per the README.After upgrading to Storybook 8, our tests fail in a flaky way, e.g.:
In the browser, there are no problems, only happens when using the test-runner.
To Reproduce
Unfortunately I don't see a way to reproduce this reliably, but our repository is public: https://github.com/open-formulieren/open-forms-sdk/tree/chore/662-sb-upgrade
# clone repo npm ci npm run storybook
and in a different tab/shell:
Expected behavior
Tests only run when the story story is ready
Screenshots
n/a
System
Additional context
I have an outdated theme addon that needs to be replaced still, no idea if that could be messing things up 🤔
The relevant code throwing the error appears to be this: https://github.com/storybookjs/storybook/blob/718ae4ad3352d2bc69f95c0cfab25b4b075e2308/code/lib/preview-api/src/modules/preview-web/Preview.tsx#L106
The text was updated successfully, but these errors were encountered: