Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 「axeを活用して、アクセシビリティをちゃんと理解しなくても、アクセシビリティを担保したhtmlを書く」 #880

Merged
merged 3 commits into from Jun 5, 2023

Conversation

YasushiKobayashi
Copy link
Owner

No description provided.

@YasushiKobayashi YasushiKobayashi self-assigned this Jun 4, 2023
@YasushiKobayashi
Copy link
Owner Author

/review_gpt

@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (46b5b98) 96.96% compared to head (faa7562) 96.96%.

❗ Current head faa7562 differs from pull request most recent head a11dc53. Consider uploading reports for the commit a11dc53 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #880   +/-   ##
=======================================
  Coverage   96.96%   96.96%           
=======================================
  Files          17       17           
  Lines         132      132           
  Branches        9        9           
=======================================
  Hits          128      128           
  Misses          4        4           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@YasushiKobayashi
Copy link
Owner Author

/review_gpt

@YasushiKobayashi
Copy link
Owner Author

/review_gpt

3 similar comments
@YasushiKobayashi
Copy link
Owner Author

/review_gpt

@YasushiKobayashi
Copy link
Owner Author

/review_gpt

@YasushiKobayashi
Copy link
Owner Author

/review_gpt

@YasushiKobayashi
Copy link
Owner Author

review_gpt

@YasushiKobayashi
Copy link
Owner Author

/review_gpt

1 similar comment
@YasushiKobayashi
Copy link
Owner Author

/review_gpt

await axeRunner(page, disableRules)
// eslint-disable-next-line no-plusplus
await page.screenshot({ path: `${basePath}/${i++}.png`, fullPage: true })
}
Copy link

Choose a reason for hiding this comment

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

このパッチコードは、PlaywrightとAxeCoreを使用して、ページのアクセシビリティ問題を検出し、テスト結果をスクリーンショットとして保存するためのものです。コードに重大なバグのリスクは見当たりませんが、baseDiriなどの変数名はより具体的でわかりやすい名前が望まれます。また、axeRunner()関数内のエラーハンドリングが十分ではなく、ログを出力しただけでtest.fail()がコメントアウトされているため、障害発生時の処理を改善する必要があります。


今回サンプルコードにした内容や、動作確認で使用したコードは全てこちらの PR で作成しており、すべて動作確認可能です。

https://github.com/YasushiKobayashi/samples/pull/880
Copy link

Choose a reason for hiding this comment

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

このパッチは、Jest-axeと@axe-core/playwrightを使用してアクセシビリティテストを実施するための設定や関数が含まれています。jest.setup.jsファイルにAxeのセットアップを行い、単位コンポーネントごとのテストを可能にします。さらにhygenを使用してテンプレート内でテストを作成し、Playwgiht axeを使ってE2Eテストでもアクセシビリティテストを実行します。また、除外設定を含めて各種ルールについても説明されています。提供されたサンプルリポジトリは、すべてのコードと動作確認の PR が含まれているため、参考にしやすいです。

@YasushiKobayashi YasushiKobayashi merged commit a58adbf into master Jun 5, 2023
5 checks passed
@YasushiKobayashi YasushiKobayashi deleted the feature/axe branch June 5, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants