-
Notifications
You must be signed in to change notification settings - Fork 5
0143-01 / ARIA23のテストを追加(事例1) #276
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="ja"> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>WAIC-CODE-0143-01</title> | ||
| <meta name="copyright" content="This document is licensed under a Creative Commons 4.0"> | ||
| <link rel="license" href="https://creativecommons.org/licenses/by/4.0/"> | ||
| <meta name="author" content="ウェブアクセシビリティ基盤委員会(WAIC)"> | ||
| <style> | ||
| #chatMessage { | ||
| list-style: none; | ||
| } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div role="main"> | ||
| <h1>チャット</h1> | ||
| <p>メッセージを送信すると、「会話のログ」見出しの後にメッセージが表示されます。<br>その後、3秒おきに2回、自動返信のメッセージが追加で表示されます。</p> | ||
| <div role="group" aria-labelledby="messageHeading"> | ||
| <h2 id="messageHeading">メッセージ入力</h2> | ||
| <p id="messageDescription">(メッセージの入力内容は変更できません)</p> | ||
| <input type="text" name="fakeinput" readonly value="こんにちわ" aria-describedby="messageDescription"> | ||
| <button id="messageButton" onclick="initiateChat()">メッセージを送る</button> | ||
| </div> | ||
| <div> | ||
| <h2 id="chatHeading">会話のログ</h2> | ||
| <div id="chatLog" role="log" aria-labelledby="chatHeading"> | ||
| <ul id="chatMessage"></ul> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
|
|
||
| <script> | ||
| var counter = 0; | ||
| var myVar; | ||
| var onetime = 0; | ||
| function makeChat () { | ||
| var chatText = ["自動返信:こんにちわ!", "自動返信:返信はこれで終了です"]; | ||
| var chatContent = document.getElementById("chatMessage"); | ||
| var list = document.createElement("li") | ||
| var item = document.createTextNode(chatText[counter]); | ||
| list.appendChild(item); | ||
| chatContent.appendChild(list); | ||
| counter++; | ||
| if (counter > 1) { | ||
| clearInterval(myVar); | ||
| } | ||
| } | ||
| function initiateChat () { | ||
| if (onetime < 1) { | ||
| document.getElementById("chatMessage").innerHTML += "<li>あなた:こんにちわ</li>"; | ||
| myVar = setInterval(makeChat, 3000); | ||
| document.getElementById("messageButton").disabled = true; | ||
| onetime++; | ||
| } else { | ||
| return false; | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # テスト ID | ||
|
|
||
| WAIC-TEST-0143-01 | ||
|
|
||
| # テストのタイトル | ||
|
|
||
| role属性による逐次的な更新の通知(role="log"の使用) | ||
|
|
||
| # テストの目的 | ||
|
|
||
| role="log"を持つ要素の内容を更新した際に、更新内容だけが通知されることを確認する。 | ||
|
|
||
| # テストの対象となる達成基準 (複数) | ||
|
|
||
| 4.1.3 | ||
|
|
||
| # 関連する達成方法 (複数) | ||
|
|
||
| ARIA23 | ||
|
|
||
| # テストコードのソース (抜粋) | ||
|
|
||
| ```html | ||
| <h2 id="chatHeading">会話のログ</h2> | ||
| <div id="chatLog" role="log" aria-labelledby="chatHeading"> | ||
| <ul id="chatMessage"></ul> | ||
| </div> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. role="log" に対してラベルの設置をすべきか悩みましたが、log ロール領域の識別のためにはラベルは必要と捉えました。 以下、手元での簡単な確認の結果となります。
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. コンテンツから labelledby を削除した |
||
| ``` | ||
|
|
||
| ```JavaScript | ||
| function makeChat () { | ||
| var chatText = ["自動返信:こんにちわ!", "自動返信:返信はこれで終了です"]; | ||
| var chatContent = document.getElementById("chatMessage"); | ||
| var list = document.createElement("li") | ||
| var item = document.createTextNode(chatText[counter]); | ||
| list.appendChild(item); | ||
| chatContent.appendChild(list); | ||
| counter++; | ||
| if (counter > 1) { | ||
| clearInterval(myVar); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| # テスト手順 (視覚閲覧環境) | ||
|
|
||
| ## テスト手順 1 | ||
|
|
||
| 「メッセージを送る」ボタンを押下する | ||
|
||
|
|
||
| ## 期待される結果 1 | ||
|
|
||
| 「会話のログ」見出しの後に、「あなた:こんにちわ」と表示される | ||
|
|
||
| ## テスト手順 2 | ||
|
|
||
| 「メッセージを送る」の押下後、何もしないまま6秒程度待つ | ||
|
|
||
| ## 期待される結果 2 | ||
|
|
||
| 3秒後に「自動返信:こんにちわ!」と通知され、さらに3秒後に「自動返信:返信はこれで終了です」と表示される | ||
|
|
||
| # テスト実施時の注意点 (視覚閲覧環境) | ||
|
|
||
| - ブラウザのJavaScriptが有効になっていることを確認すること | ||
|
|
||
| # テスト手順 (音声閲覧環境) | ||
|
|
||
| ## テスト手順 1 | ||
|
|
||
| 「メッセージを送る」ボタンを押下する | ||
|
|
||
| ## 期待される結果 1 | ||
|
|
||
| 「あなた:こんにちわ」と通知される | ||
|
|
||
| ## テスト手順 2 | ||
|
|
||
| 「メッセージを送る」の押下後、何もしないまま6秒程度待つ | ||
|
|
||
| ## 期待される結果 2 | ||
|
|
||
| 3秒後に「自動返信:こんにちわ!」と通知され、さらに3秒後に「自動返信:返信はこれで終了です」と通知される | ||
|
|
||
| # テスト実施時の注意点 (音声閲覧環境) | ||
|
|
||
| - ブラウザのJavaScriptが有効になっていることを確認すること | ||
| - テストの通知を待つ間に他の通知が生じた場合、他の通知の完了後にテストによるメッセージが通知される。そのため、必ずしも3秒後にメッセージが通知されるとは限らない | ||
|
||
|
|
||
| # 関連する要素や属性 | ||
|
|
||
| role属性、aria-labelledby属性 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
逐次的な更新に対して、更新内容だけが通知されることの確認をテストの目的としています。
更新の都度、role="log" が示す領域全体の内容が通知されることを弾きたい意図です。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
相談事項:
ARIA23 のタイトルは「逐次的な情報更新を識別するために role=log を使用する」となっています。
「逐次的な情報更新を識別する」は、変更箇所のみが通知される(aria-atomic="false")ことで識別できると判断して良いでしょうか?
あるいは、logロールが通知されることで満たされると判断した方が良いでしょうか?
現状では、logロールの通知は必須ではなく「変更箇所のみが通知される」で十分と判断してテスト手順などを作成しています。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.