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
I am attempting to use the tags to opt-out of specific tests within the test runner.
The tags array on the context object returned from getStoryContext() does not match the tags as defined in the index.json file.
To Reproduce
Storybook is built using: storybook build --test
Test Runner is run with: test-storybook --junit --failOnConsole --ci --url http://127.0.0.1:6006
Using the following simplified ./storybook/test-runner.ts file; the tags array on the storyContext object is always ["story"].
importtype{TestRunnerConfig}from"@storybook/test-runner";import{getStoryContext,waitForPageReady}from"@storybook/test-runner";import{injectAxe,checkA11y}from"axe-playwright";// See https://storybook.js.org/docs/writing-tests/test-runner#test-hook-apiconstconfig: TestRunnerConfig={tags: {skip: ["skip-test"],},asyncpreVisit(page){awaitinjectAxe(page);},asyncpostVisit(page,context){// See https://storybook.js.org/docs/writing-tests/test-runner#helpersconststoryContext=awaitgetStoryContext(page,context);constskipA11y=storyContext.tags.includes("skip-a11y");constskipVisual=storyContext.tags.includes("skip-visual");// See https://storybook.js.org/docs/writing-tests/storyshots-migration-guide#run-image-snapshot-tests-with-the-test-runnerif(!skipVisual){// removed for simplicity}// See https://storybook.js.org/docs/writing-tests/accessibility-testing#disable-a11y-tests-with-the-test-runnerif(!skipA11y){awaitcheckA11y(page,'#storybook-root',{detailedReport: true,detailedReportOptions: {html: true,},});}}};exportdefaultconfig;
Expected behavior
The tags array on storyContext object matches the tags listed in the index.json file for the given story.
Describe the bug
I am attempting to use the tags to opt-out of specific tests within the test runner.
The tags array on the context object returned from
getStoryContext()
does not match the tags as defined in the index.json file.To Reproduce
storybook build --test
test-storybook --junit --failOnConsole --ci --url http://127.0.0.1:6006
./storybook/test-runner.ts
file; thetags
array on thestoryContext
object is always["story"]
.Expected behavior
The tags array on storyContext object matches the tags listed in the index.json file for the given story.
System
Additional context
Example snippet from the index.json file:
The text was updated successfully, but these errors were encountered: