# Accessibility regression and manual review

The site has Playwright browser tests with axe-core for WCAG 2.2 AA-oriented
rules. The tests examine rendered pages and important interactive states,
including the open assistant dialog and mobile navigation.

## Repeatable browser checks

From the repository root:

```bash
make test-accessibility
```

By default, browser checks fail when axe-core confirms a **serious** or
**critical** violation on an audited page or interaction. The same gate runs
in both `make test-accessibility` and `make test-e2e`. The intentionally
broken fixture verifies that the gate really fails when these issues are
introduced.

For diagnostics **only**, you can record findings without enforcing the
serious/critical gate:

```bash
A11Y_STRICT=0 make test-accessibility
```

Non-strict mode is not an acceptable production quality gate. Even strict
automated checks cannot certify WCAG conformance: axe-core reports incomplete
items requiring manual review, including contrast and ARIA states.

Playwright attaches JSON summaries for each inspected page/state with
rule IDs, impacts, selectors, success-criteria tags, and manual-review
items. Traces and screenshots are retained on failure. These reports must
not include page text, authentication tokens, or user-submitted data.

Each normal `make test-e2e` or `make test-accessibility` run also writes
two generated, ignored files without running an extra browser scan:

- `esobczakcomwebsite/test-results/accessibility/report.html` — readable
  page/state summaries, severe counts, rule IDs, selectors, links to rule
  documentation, and items needing manual review. The worklist groups repeated
  incomplete findings by rule and affected states, without calling them
  confirmed defects.
- `esobczakcomwebsite/test-results/accessibility/report.json` — the same
  sanitized evidence in machine-readable form, including browser scan times.

If navigation or an audit fails before evidence is attached, it appears as
**Not scanned**, not as a clean result. Passing strict browser tests establishes no confirmed serious/critical
automated violations in the sampled states, not that all pages or manual
requirements are clear. In GitHub's Site quality
workflow, these small reports are saved as a short-retention build artifact.
They are not publicly hosted or automatically published to the website.

The report contains only pathname, authored test title, rule metadata,
selectors, and timestamps. It intentionally omits the query string, page
HTML, browser cookies, credentials, and submitted form values.

## Manual review checklist

- Navigate every important page and interaction using only Tab,
  Shift+Tab, Enter, Space and Escape; inspect focus order and visible focus.
- Test with VoiceOver and NVDA or another screen reader. Confirm meaningful
  accessible names, landmarks, heading hierarchy and error announcements.
- Verify 200%/400% zoom, narrow-screen reflow, large text and reduced motion.
- Inspect color contrast for default, hover, focus, disabled, and error states.
- Test forms with empty, invalid and successful submissions; verify labels,
  validation text and dynamic status announcements.
- Check dialogs for initial focus, contained focus, Escape behavior and
  return focus to the trigger. Repeat with mobile navigation.
- Verify media captions/transcripts where relevant and any timing or keyboard
  traps that automation may not detect.

## Public source accessibility score (rubric version 1)

The standalone `/resources/accessibility-scanner/` and combined
`/resources/scanner/` use the same bounded HTML-source audit. The score
is a versioned, local readiness indicator, not WCAG conformance or a
Lighthouse score. The ten source rule groups have these weights:

| Rule                    | Weight |
| ----------------------- | -----: |
| Document language       |     10 |
| Document title          |      8 |
| Main landmark           |      5 |
| Top-level heading       |      5 |
| Image text alternatives |     15 |
| Accessible link names   |     12 |
| Accessible button names |     12 |
| Form control labels     |     18 |
| Embedded frame names    |      8 |
| Unique HTML IDs         |      7 |

The first four rules always apply. Other rules with no inspected instances
are not applicable and contribute neither earned nor possible points.
An applicable group earns its entire weight only when no inspected instance
is flagged; adding more passing links or images within a failing group
cannot dilute the failure. The source score is the earned weight divided
by applicable weight, rounded down to an integer percentage. Grades use
the common scanner thresholds (100 A+, 90 A, 80 B, 70 C, 60 D, otherwise F).
The standalone report shows the applicable-rule coverage, points and
instance counts; the 50-finding preview cap does not affect scores.
Different rule applicability can affect comparisons across pages.

Only successful numerical source scores contribute once to the combined
score, with the same equal weight as other scored checkers. A zero is a
valid score; blocked, failed, invalid or unavailable results do not enter
the denominator. Aggregate coverage indicates incomplete results. No
Google API request is needed to compute the source accessibility score.

## Combined Website Scanner and browser evidence

The combined report also displays the accessibility category from its
existing mobile Google PageSpeed Insights request, when available, as
additional browser evidence. Lighthouse accessibility is not counted a
second time in the aggregate: only its performance category contributes.
If Google cannot return a valid accessibility category, that separate
browser result is explicitly not evaluated. Neither source nor browser
scores establish WCAG conformance. Manual keyboard, screen-reader,
focus, zoom, contrast and dynamic-interaction checks remain essential.

The combined scanner does **not** execute the repository's Playwright/axe-core
suite against arbitrary user-submitted domains. That would require an
isolated browser service with public-target validation, redirect
restrictions, strict resource/time/concurrency budgets and sanitized
reporting. The local axe suite remains a separate CI gate.
