{"id":13341399,"url":"https://github.com/ttsukagoshi/axe-test","last_synced_at":"2025-03-11T21:30:55.878Z","repository":{"id":39414447,"uuid":"379177043","full_name":"ttsukagoshi/axe-test","owner":"ttsukagoshi","description":"テキストファイルで指定する複数のウェブページに対して、Deque社提供のaxe-coreを使ったウェブアクセシビリティ検査を一括実行する、Node.js上のスクリプト","archived":true,"fork":true,"pushed_at":"2022-11-18T14:34:31.000Z","size":570,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main-ops","last_synced_at":"2024-10-24T08:30:20.443Z","etag":null,"topics":["a11y","axe-core","puppeteer","web-accessibility"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"caztcha/axe-test","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttsukagoshi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-22T07:15:56.000Z","updated_at":"2023-10-25T17:39:23.000Z","dependencies_parsed_at":"2023-01-21T23:00:44.430Z","dependency_job_id":null,"html_url":"https://github.com/ttsukagoshi/axe-test","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttsukagoshi%2Faxe-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttsukagoshi%2Faxe-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttsukagoshi%2Faxe-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttsukagoshi%2Faxe-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttsukagoshi","download_url":"https://codeload.github.com/ttsukagoshi/axe-test/tar.gz/refs/heads/main-ops","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243115312,"owners_count":20238738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a11y","axe-core","puppeteer","web-accessibility"],"created_at":"2024-07-29T19:25:25.840Z","updated_at":"2025-03-11T21:30:55.535Z","avatar_url":"https://github.com/ttsukagoshi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ウェブアクセシビリティ検証ツール「axe-test」\n\n\u003e 本Forkは現在、更新されていません。ttsukagoshi/axe-testの機能は [axe-scan](https://github.com/ttsukagoshi/axe-scan)に引き継がれましたので、そちらをご利用ください。\n\nDeque Systems, Inc. が開発、公開しているウェブアクセシビリティ検証ツール「[axe](https://www.deque.com/axe/)」のコアエンジン「axe-core」を利用して、ウェブサイトのアクセシビリティ自動テストを実行するためのスクリプトです。Node.js ライブラリ「[Puppeteer](https://pptr.dev/)」と併せて使います。\n\nウェブサイト全体 (数百ページ規模) を対象に、一括処理でアクセシビリティを検証し、その結果を、日本語でスプレッドシート (.csv ファイル) に出力することができます。\n\n## 事前準備\n\n### Node.js のインストール\n\n[Node.js のサイト](https://nodejs.org/ja/)から、Node.js のインストーラー（最新 LTS 版）をお使いのパソコンにダウンロードし、実行します。Node.js と npm (Node Package Manager) がインストールされます。\n\n### 本レポジトリ内のフォルダ一式をローカル環境にコピー\n\n[ttsukagoshi/axe-test](https://github.com/ttsukagoshi/axe-test)の右上にある「Code」で「Download ZIP」を選択し、お好みの場所で解凍してください。以下、ここで解凍したフォルダを「作業フォルダ」と呼びます。\n\nレポジトリを fork, `git clone` などをご存知の方は、お好きな方法でどうぞ。\n\n### Dependencies のインストール\n\n作業フォルダでターミナル（コマンドプロンプト）を開き、次のコマンドを実行します。\n\n```\nnpm ci\n```\n\n## アクセシビリティ自動テストを実行する\n\n### 対象 URL リストを作業フォルダ内で作成\n\nテスト対象となる URL 一覧を記載したテキストファイルを作成し、「**urls.txt**」というファイル名で保存します。テキストファイルの中身は、1 行ごとに 1 つの URL を記述しただけのものにしてください。\n(なお、Basic 認証が適用されているページに対してテストを実行する場合は、各行の URL 記述を https://userid:password@example.com/ という具合にします。)\n\n### テストの実行\n\nターミナル (コマンドプロンプト) が作業フォルダにあることを確認して、以下のように入力します。\n\n```\nnode .\n```\n\nテストの実行には少し時間がかかると思います（数百ページ規模だと、数十分かかるかもしれません）。`アクセシビリティ検査が完了しました。` と表示されれば検査完了です。作業フォルダ直下に `axe-results.csv` という.csv ファイルが生成されます。あとはこれを Excel や Google スプレッドシートで開いて、適宜ご活用ください。\n\n\u003cimg width=\"1294\" alt=\"「axe-test.js」によって出力されたテスト結果 (.csv) のイメージ\" src=\"https://user-images.githubusercontent.com/55706659/151901139-a87e171b-c37d-4938-867d-14183982eb1d.png\"\u003e\n\n### オプション設定\n\n作業フォルダ直下にある `user-settings.json` を編集することで、初期設定を変更できます。\n\n#### 設定できる値\n\n\u003c!-- prettier-ignore --\u003e\n| 変数名 | データ型 | 意味 | 初期値 |\n| --- | --- | --- | --- |\n| `axeCoreTags` | *Array* | テストの基準となるアクセシビリティ水準を指定します。初期値は、WCAG 2.1 (および 2.0) の、達成基準レベル A と AA に相当するテストルールを適用して、テストを実行する設定となっています。ここに記述可能な水準については、[axe API Documentation の 「Axe-core Tags」のセクション](https://www.deque.com/axe/core-documentation/api-documentation/#user-content-axe-core-tags) をご参照ください。 | `[\"wcag2a\", \"wcag2aa\", \"wcag21a\", \"wcag21aa\"]` |\n| `resultTypes` | *Array*  | 出力する結果の種類を指定します。 `inapplicable`: 判定対象外の基準/`incomplete`: 適合しているか判断できなかった基準/ `passes`: 適合している判断とされた基準/ `violations`: 適合していないと判断された基準。詳細は公式ドキュメントをご参照ください: https://www.deque.com/axe/core-documentation/api-documentation/#options-parameter | `[\"incomplete\", \"violations\"]` |\n| `inputPath` | *String*  | URL一覧のテキストファイルのファイルパス | `./urls.txt` |\n| `inputEncode` | *String*  | URL一覧のテキストファイルの文字エンコード。サポートされている形式については公式ドキュメントを参照: https://nodejs.org/api/buffer.html#buffers-and-character-encodings | `utf8` |\n| `outputPath` | *String*  | 出力するCSVのファイルパス | `./axe-results.csv` |\n| `outputEncode` | *String*  | 出力するCSVファイルの文字エンコード。サポートされている形式については公式ドキュメントを参照: https://nodejs.org/api/buffer.html#buffers-and-character-encodings | `utf8` |\n\n#### `user-settings.json` の例\n\n変更した項目だけ残して、残りは削除しても問題ありません。削除した項目では自動的に初期値が適用されます。\n\n```json\n{\n  \"axeCoreTags\": [\"wcag2a\", \"wcag2aa\"],\n  \"resultTypes\": [\"violations\"],\n  \"inputPath\": \"./private/urls.txt\",\n  \"inputEncode\": \"utf16le\"\n}\n```\n\n### コマンドラインへの出力\n\n実行コマンドに `--cli` とつけることで、ファイル出力の代わりにコマンドライン出力できます。\n\n```\nnode . --cli\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttsukagoshi%2Faxe-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttsukagoshi%2Faxe-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttsukagoshi%2Faxe-test/lists"}