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
When attempting to automate accessibility tests with the provided code snippet in Storybook's documentation : https://storybook.js.org/docs/writing-tests/accessibility-testing#setup, the test runner encounters errors related to page.evaluate: ReferenceError: __test is not defined. This occurs when attempting to generate an HTML report using axe-playwright or axe-html-reporter.
To Reproduce
Use the provided code snippet in Storybook's documentation for automating accessibility tests.
Attempt to generate an HTML report using axe-playwright or axe-html-reporter:
if this issue is about errors that happen when using axe-playwright or axe-html-reporter, then it is not a duplicate of the linked issue in the test runner repository. the linked issue has the same error message as a symptom, but it occurs in the absence of those accessibility tools, so it likely has a different cause
Hello @aimad-majdou! 👋🏻
I ran into the same issue when trying to generate an HTML report for my components in Storybook. After some debugging, I discovered that the problem occurs with axe-html-reporter when attempting to create a file with the .html extension.
I’m not entirely sure why this happens, but one workaround that worked for me was explicitly setting the report extension to .htm instead. Functionally, it’s the same as.html format, and after making this change, the issue never reappeared.
Here’s an example of what the updated code might look like (note that the HTML report options are passed as the last argument):
Describe the bug
When attempting to automate accessibility tests with the provided code snippet in Storybook's documentation : https://storybook.js.org/docs/writing-tests/accessibility-testing#setup, the test runner encounters errors related to page.evaluate: ReferenceError: __test is not defined. This occurs when attempting to generate an HTML report using axe-playwright or axe-html-reporter.
To Reproduce
reproduction: https://stackblitz.com/edit/github-dwueer?file=package.json,.storybook%2Fmain.ts&preset=node
System
Additional context
No response
The text was updated successfully, but these errors were encountered: