Repository: storybook
Issue: [Tracking]: Unified a11y tests 
Labels: feature request,Tracking,addon: test

## 🧑‍🤝‍🧑 Who: @kasperpeulen and @valentinpalkovic 

This is a tracking issue for the Unified a11y tests  project. Its purpose is to keep track of the overall status of the project and tasks and plan everything around it.

## ⚠️ Problem

Accessibility (a11y) is increasingly required in modern UIs. This is already enforced for many government services around the world, and is also becoming mandated for private services as well, e.g. [European accessibility act](https://ec.europa.eu/social/main.jsp?catId=1202) which goes into law in June 2025.

Today, Storybook’s accessibility addon addon-a11y is one of the most popular addons not bundled with Storybook at 1.6M weekly npm dl’s. It provides a way to interactively test and debug a11y violations in stories

The biggest a11y product gap today is that you have to manually click on each story to see the a11y violations for that specific story. There is no way to do this across all stories in batch.

If we can solve this problem in the context of our Unified UI Testing project, it will go a long way towards improving support for A11y workflows in Storybook AND make our unified testing UI that much more compelling.

## 🏁 Goals

1. As a Storybook user, I want to be able to run a11y tests across all the stories in my Storybook, so that I can see the full a11y status of my project.

## 🚩 Milestones

```[tasklist]
## Finalize API's - Deadline: 13th Nov
- [x] Finalize Reporting API specification - Event name and payload conventions | capabilities
- [x] Finalize afterEach specification
- [x] Investigate discrepancy cases and how to deal with them
```

```[tasklist]
## Technical Preparations - Deadline: 22th Nov
- [ ] https://github.com/storybookjs/storybook/pull/29584
- [ ] https://github.com/storybookjs/storybook/pull/29608
```

```[tasklist]
## A11y Implementations - Deadline: 6th Dec
- [x] Register a11y Sub Test Provider (Batch run and single story run)
- [x] Change a11y reporting mechanism - Use Reporting API
- [x] Implement Vitest report proxy of a11y test results
- [x] https://github.com/storybookjs/storybook/pull/29682
- [x] https://github.com/storybookjs/storybook/pull/29661
- [x] [Scope increase]: Support a11y tags to enable/disable automatic a11y runs
- [x] [Scope increase]: Automigration: Automatically add `addon-a11y` to `.storybook/vitest.setup.ts` when upgrading to > 8.5.0
- [x] [Scope increase]: Addon-Test postinstall script: Consider addon-a11y if it is already installed
- [x] Documentation
- [x] Refactor status handling in frontend (Remove https://github.com/storybookjs/storybook/pull/29643/files#diff-0912d15d65479bd34f1802061483276d04484fdf7359fd9f9a53b1decd323b8eR147-R186 and sync with Gert)
- [ ] Adjust version range for automigration (https://github.com/storybookjs/storybook/pull/29643/files#diff-f0bd0ad5176683fc69b35a8f3d857e7e901b8a1d439d6aa65dad42dd8efbb071R25-R26)
- [ ] Merge https://github.com/storybookjs/storybook/pull/29643
```

```[tasklist]
## After QA
- [ ] https://github.com/storybookjs/storybook/issues/29644
- [x] Release @storybook/csf and update its version in monorepo
- [x] Update "init" components to be accessible for each framework
- [x] Adjust CI to adjust sandbox generation to include addon-a11y + writing E2E tests
```

```[tasklist]
## Bugs
- [x] @storybook/addon-a11y/preview -> Typescript reports error in certain configurations
- [x] The a11y addon panel's tab doesn't show the violation number anymore
- [ ] preview.js file is cached aggressively by vitest - restart of Storybook necessary
- [ ] In Vitest 2.1.4 and later, the status of Accessibility in the Testing module remains unknown
```

```[tasklist]
## Nice to have
- [ ] Add postinstall script to @storybook/addon-a11y to update vitest.setup.<ts|js> file if @storybook/experimental-addon-test is installed
- [ ] A11y addon improvements. Rework addon experience per Accessibility addon V2 design
- [ ] Investigate: Optimize accessibility testing to manage inherited violations in Storybook components
- [ ] https://github.com/storybookjs/storybook/pull/29552
- [ ] Improve accessibility of our own Storybook components
```

## 🚩 Out of scope

- Create a unified API to replace Status API, Testing Module API and Reporting API.