Skip to content

test: axe-coreアクセシビリティE2Eを追加#589

Merged
Suree33 merged 12 commits into
mainfrom
codex/issue-566-axe-core
Jun 30, 2026
Merged

test: axe-coreアクセシビリティE2Eを追加#589
Suree33 merged 12 commits into
mainfrom
codex/issue-566-axe-core

Conversation

@Suree33

@Suree33 Suree33 commented Jun 30, 2026

Copy link
Copy Markdown
Owner

概要

  • Playwright E2E に @axe-core/playwright を追加し、ホーム・About・代表記事をデスクトップ/モバイル、ライト/ダークで検査
  • serious / critical の違反だけを失敗条件とし、全12スキャンの完全なaxe結果をJSON添付
  • 初期スキャンで見つかったダークテーマのコントラスト違反と、モバイルメニューtransition中の不定検出を修正
  • 検査行列、レポートの見方、自動検査の限界をE2Eドキュメントへ追記

背景・影響

axe-coreが機械的に判定できる重大なアクセシビリティ問題の再混入を、既存のE2E CIで検出できるようになります。minor / moderateincomplete もレポートへ残しつつ、CIノイズを抑えるためブロッキング対象は serious / critical に限定しています。

初回実行では、ダークテーマのメタデータ文字色が背景に対して4.17:1だったため、既存のデザイントークン dark:text-neutral-400 へ揃えて7.66:1を確保しました。また、モバイルメニューは固定sleepではなく、ヘッダー配下のanimation/transition完了を待ってから解析します。

表示プレビュー

About(ダークテーマ)

変更前 変更後
変更前のAboutページ関心分野 変更後のAboutページ関心分野

記事メタデータ(ダークテーマ)

変更前 変更後
変更前の代表記事タグと公開日 変更後の代表記事タグと公開日

検証

  • pnpm exec prettier --check package.json tests/e2e/specs/accessibility.spec.ts tests/e2e/components/header.ts src/pages/about.astro src/components/PostMetadata.astro docs/e2e-testing.md
  • pnpm run lint
  • pnpm exec playwright test tests/e2e/specs/accessibility.spec.ts — 6 passed / 12 skipped、JSON添付12件、serious 0 / critical 0
  • pnpm run test:e2e — 152 passed / 28 skipped
  • git diff --check

Closes #566

Summary by CodeRabbit

  • New Features

    • Added automated accessibility (axe-core) scanning to end-to-end testing, running on both desktop and mobile in light/dark modes.
    • Extended RSS feed end-to-end coverage to include both desktop and mobile runs.
  • Bug Fixes

    • Improved dark-mode styling for tag/date metadata and about-page text for better contrast in automated checks.
    • Reduced end-to-end flakiness by improving synchronization after opening the mobile menu.
  • Documentation

    • Updated E2E testing documentation with the new accessibility test matrix, scan scope, and reporting/failure rules.

Suree33 and others added 11 commits June 30, 2026 00:11
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef3109ed-5eed-42b8-9b13-3fd8ae15beca

📥 Commits

Reviewing files that changed from the base of the PR and between cd79dea and 921785c.

📒 Files selected for processing (2)
  • docs/superpowers/plans/2026-06-30-axe-core-accessibility-e2e.md
  • docs/superpowers/specs/2026-06-30-axe-core-accessibility-e2e-design.md
✅ Files skipped from review due to trivial changes (2)
  • docs/superpowers/specs/2026-06-30-axe-core-accessibility-e2e-design.md
  • docs/superpowers/plans/2026-06-30-axe-core-accessibility-e2e.md

📝 Walkthrough

Walkthrough

Adds axe-core Playwright accessibility scans for three pages across light and dark themes, limited to supported browser projects, and fails only on serious or critical violations. Updates the mobile menu helper, dark-mode styles, and E2E docs to match the new workflow.

Changes

axe-core Accessibility E2E

Layer / File(s) Summary
Dependency and dark-mode styles
package.json, src/components/PostMetadata.astro, src/pages/about.astro
Adds @axe-core/playwright to devDependencies and adds dark:text-neutral-400 to two Astro components.
Mobile menu animation wait
tests/e2e/components/header.ts
Updates openMobileMenu() to wait for aria-expanded="true" and for header subtree animations/transitions to complete.
Accessibility spec implementation
tests/e2e/specs/accessibility.spec.ts
Adds project/theme filtering, per-theme axe scans, JSON attachments, serious/critical violation collection, and three page-level tests.
E2E documentation updates
docs/e2e-testing.md
Documents the new accessibility spec, the updated RSS scope, and the revised project matrix.
Design and implementation notes
docs/superpowers/specs/2026-06-30-axe-core-accessibility-e2e-design.md, docs/superpowers/plans/2026-06-30-axe-core-accessibility-e2e.md
Adds the design spec and implementation plan for the accessibility E2E rollout.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Suree33/blog#562: Updates tests/e2e/components/header.ts and related E2E behavior around mobile menu timing.
  • Suree33/blog#575: Introduces the RSS E2E test whose project coverage is updated here.

Poem

🐇 Hop hop, the a11y bells ring clear,
Dark and light now both appear.
Menu waits till motion's done,
Axe checks pages one by one.
Serious bugs? They won't sneak through—
This bunny leaves a cleaner queue.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding axe-core accessibility E2E tests.
Linked Issues check ✅ Passed The PR adds axe-core Playwright E2E checks for home, About, and a representative article, and updates docs as requested.
Out of Scope Changes check ✅ Passed The changes stay within the accessibility E2E work and its follow-up fixes; no unrelated scope is evident.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-566-axe-core

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
blog 921785c Commit Preview URL

Branch Preview URL
Jun 30 2026, 12:47 PM

@Suree33 Suree33 marked this pull request as ready for review June 30, 2026 06:49
@Suree33 Suree33 changed the title [codex] axe-coreアクセシビリティE2Eを追加 test: axe-coreアクセシビリティE2Eを追加 Jun 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/superpowers/specs/2026-06-30-axe-core-accessibility-e2e-design.md (1)

141-146: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider clarifying the root cause of the nondeterministic failures.

The document states that transition-related color-contrast violations "only reproduce on light-to-dark continuous checks, not independent dark theme starts." While the getAnimations wait is the correct fix regardless, this specific claim may be an overgeneralization from observed symptoms rather than the actual root cause. The race condition fundamentally exists whenever openMobileMenu() returns before CSS transitions complete, independent of theme sequence. Consider rephrasing to emphasize that the issue was diagnosed from light-to-dark runs but the fix addresses the underlying synchronization gap for all cases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/specs/2026-06-30-axe-core-accessibility-e2e-design.md`
around lines 141 - 146, The mobile menu timing section overstates the root cause
by tying the nondeterministic `color-contrast` failures too specifically to
light-to-dark runs. Rephrase the explanation around the actual synchronization
gap in `Header.openMobileMenu()`—it returns before the CSS transitions finish
and axe can sample intermediate colors—while noting that the light-to-dark
sequence was just how the issue was observed. Keep the fix description centered
on waiting for `Element.getAnimations({ subtree: true })`/animation completion
after `aria-expanded` changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/superpowers/plans/2026-06-30-axe-core-accessibility-e2e.md`:
- Around line 64-204: The verification step assumes testInfo.attach() writes
loose JSON files under test-results, but Playwright stores attachments in the
report output instead. Update the Step 3 instructions for accessibility.spec.ts
to verify axe-results attachments via the HTML report or configured report
directory (for example with playwright show-report), and note that CI should
inspect the reporter artifacts rather than searching test-results directly.
- Around line 19-63: The Step 3 verification for importing AxeBuilder is using a
pnpm-wrapped Node invocation that can break ESM flag handling; update the check
in the plan to use a direct Node ESM import path or a temporary .mjs script
instead. Also align the dependency version claim in the `@axe-core/playwright`
add step with the stack’s `4.12` version, and keep the guidance consistent
across `Step 2` and `Step 3` in this plan document.

---

Nitpick comments:
In `@docs/superpowers/specs/2026-06-30-axe-core-accessibility-e2e-design.md`:
- Around line 141-146: The mobile menu timing section overstates the root cause
by tying the nondeterministic `color-contrast` failures too specifically to
light-to-dark runs. Rephrase the explanation around the actual synchronization
gap in `Header.openMobileMenu()`—it returns before the CSS transitions finish
and axe can sample intermediate colors—while noting that the light-to-dark
sequence was just how the issue was observed. Keep the fix description centered
on waiting for `Element.getAnimations({ subtree: true })`/animation completion
after `aria-expanded` changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9a9b8259-ad4b-4426-9b22-de94362d96b6

📥 Commits

Reviewing files that changed from the base of the PR and between adb095a and cd79dea.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • docs/e2e-testing.md
  • docs/superpowers/plans/2026-06-30-axe-core-accessibility-e2e.md
  • docs/superpowers/specs/2026-06-30-axe-core-accessibility-e2e-design.md
  • package.json
  • src/components/PostMetadata.astro
  • src/pages/about.astro
  • tests/e2e/components/header.ts
  • tests/e2e/specs/accessibility.spec.ts

Comment thread docs/superpowers/plans/2026-06-30-axe-core-accessibility-e2e.md
Comment thread docs/superpowers/plans/2026-06-30-axe-core-accessibility-e2e.md
Co-authored-by: Codex <noreply@openai.com>
@Suree33 Suree33 merged commit 0127b40 into main Jun 30, 2026
9 checks passed
@Suree33 Suree33 deleted the codex/issue-566-axe-core branch June 30, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

axe-core によるアクセシビリティ E2E チェックを追加する

1 participant