You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A11y tests crash in the test runner when upgrading Storybook to v8.
I followed the upgrade manual and everything passes but the a11t tests in the test runner.
It's saying
Additional Context
Here's the test-runner.ts file I have
importtype{TestRunnerConfig}from'@storybook/test-runner';import{getStoryContext}from'@storybook/test-runner';import{checkA11y,injectAxe,configureAxe}from'axe-playwright';/* * See https://storybook.js.org/docs/writing-tests/test-runner#test-hook-api * to learn more about the test-runner hooks API. */constconfig: TestRunnerConfig={tags: {include: ['a11y-include'],},asyncpreVisit(page){awaitinjectAxe(page);},asyncpostVisit(page,context){// Get the entire context of a story, including parameters, args, argTypes, etc.conststoryContext=awaitgetStoryContext(page,context);// Apply story-level a11y rulesawaitconfigureAxe(page,{rules: storyContext.parameters?.['a11y']?.config?.rules,});awaitcheckA11y(page,'#storybook-root',{detailedReport: true,axeOptions: {// Limit the result types to only violations that the test managed to findresultTypes: ['violations'],},detailedReportOptions: {html: true,},},false,'v2');},};exportdefaultconfig;
The text was updated successfully, but these errors were encountered:
Hey @AmirTugi thanks a lot for elaborating, but could you please provide a reproduction repo? You can use https://storybook.new for a minimal repro setting.
I tried the test-runner with Storybook 8.0.8 with your test-runner.ts file and the a11y tests worked without issues.
I actually find it weird that your tests failed with waitForPageReady while in your snippet such function is not used. That function is not used internally by the test-runner, only if you add it yourself. I think you might have it in your preVisit hook. Maybe what's going on is you are using Webpack and somehow the waitForPageReady function is hanging because of some Webpack request that won't resolve, but I am not sure as I don't know the configuration of your project.
Describe the bug
A11y tests crash in the test runner when upgrading Storybook to v8.
I followed the upgrade manual and everything passes but the a11t tests in the test runner.
It's saying
To Reproduce
Steps to reproduce the behavior:
Upgrade Storybook to
8.0.8
and use@storybook/test-runner@0.17.0
Expected behavior
The a11y tests should pass as before
Screenshots
System
Additional Context
Here's the
test-runner.ts
file I haveThe text was updated successfully, but these errors were encountered: