Scanner does not wait for client-side rendering before running axe scan
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- playwright, react, typescript
- Área
- accessibility, frontend, testing-qa
Línea de trabajo
Comienza en .github/actions/find/src/findForUrl.ts e inspecciona la secuencia desde page.goto(url) hasta AxeBuilder.analyze(). Reproduce el escaneo contra una página React renderizada en el cliente y verifica que axe observe el DOM renderizado en lugar del elemento root inicial; se considera terminado cuando los hallazgos reportados y el momento del escaneo coincidan con la página completamente renderizada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
When scanning single-page applications (React, Vue, Angular, etc.), the scanner runs the axe scan immediately after page.goto() resolves (which waits for the load event). At that point, the JavaScript bundles are loaded but the framework hasn't finished rendering the DOM yet. This means axe scans a nearly-empty <div id="root"> instead of the actual page content.
This leads to:
- False positives: Document-level violations like
landmark-one-mainandpage-has-heading-oneare reported because the landmarks and headings haven't been rendered yet. - False negatives: Element-level violations like
button-nameare missed because the elements don't exist in the DOM yet. - Misleading screenshots: Screenshots are taken after axe runs (inside
addFinding), by which time React has finished rendering. So the screenshots show the correct, fully-rendered page — even though axe scanned a different DOM state.
Steps to reproduce
- Set up the scanner against any React/SPA application
- Run a scan on a page that has proper
<main>landmarks and<h1>headings rendered by the framework - Observe that
landmark-one-mainandpage-has-heading-oneviolations are reported - Run axe dev tools manually in the browser on the same page — these violations are not found
- Observe that element-level violations found by axe dev tools (e.g.
button-name) are not reported by the scanner
Root cause
In findForUrl.ts:
await page.goto(url)
// axe runs immediately — no wait for client-side rendering
const rawFindings = await new AxeBuilder({page}).analyze()
page.goto() resolves on the load event, which fires when HTML/CSS/JS resources are loaded — but before the JS framework has executed and rendered the DOM.
Suggested fix
Add a wait for the page to be idle before running the axe scan. For example:
await page.goto(url)
await page.waitForLoadState('networkidle')
// or: await page.waitForTimeout(2000)
// or: await page.waitForFunction(() => document.querySelector('[data-testid]') !== null)
const rawFindings = await new AxeBuilder({page}).analyze()
waitForLoadState('networkidle') waits until there are no network connections for at least 500ms, which is a reasonable heuristic for "the SPA has finished its initial API calls and rendered."
Environment
github/accessibility-scanner@v2(SHA:7866232dda98e447fed8ec0d7798b322d888fd27)- React 19 application with Mantine UI, served from Docker containers via Caddy
- Authenticated via
auth_contextinput with session cookies
- Lenguaje dominante
- TypeScript
- Estrellas
- 374
- Forks
- 42
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 7
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/accessibility-scanner
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
github/accessibility-scanner#264 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
github/accessibility-scanner#260 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 50/100
github/accessibility-scanner#259 ·
-
Configurable issue labels Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
github/accessibility-scanner#245 ·
-
Sitemap Support Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
github/accessibility-scanner#244 ·
Todos los issues de github/accessibility-scanner
Issues similares
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Crush Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
ElementsProject/cln-application#167 · 1 comentario · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Quantco/pnpm-licenses#17 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100