We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently there is no stylized way to retrieve story parameters in API hooks.
This would be useful for reusing:
This could be provided automatically by the test-runner as part of the context argument.
context
async preRender(page, context) { const { parameters } = context; },
Or maybe on=demand:
async preRender(page, context) { const parameters = await getParameters(page, context); // OR const parameters = await context.getParameters(page); },
The benefit of on-demand is that the user would only "pay" the performance cost of retrieving parameters when they are actually used.
The text was updated successfully, but these errors were encountered:
I strongly want parameters for viewports configurations and skipping screenshots for some stories!
Sorry, something went wrong.
This is super important for accessibility testing, but in principle for any configuration of tests.
in the meantime I workaround this by saving story props to window in decorator and reading it back in the test
preview.tsx
export const decorators: DecoratorFn[]= [ (Story, props) => { window.STORY_PROPS = props return <Story {...props} /> }, ]
test-runner.ts
export const postRender: TestHook = async (page, context) => { const { parameters }: any = await page.evaluate("window.STORY_PROPS") // ... }
Hey peeps! This was released in v0.2.0, please check the details here. Thanks for using this library!
v0.2.0
No branches or pull requests
Currently there is no stylized way to retrieve story parameters in API hooks.
This would be useful for reusing:
This could be provided automatically by the test-runner as part of the
context
argument.Or maybe on=demand:
The benefit of on-demand is that the user would only "pay" the performance cost of retrieving parameters when they are actually used.
The text was updated successfully, but these errors were encountered: