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

WAIC-TEST-0037-01 / (関連する達成方法なし): required属性による必須項目の特定 #265

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

akiyamaa-cnt
Copy link
Contributor

ARIA2 : aria-required プロパティによって必須項目を特定するを参考に、required属性で必須項目が特定できるかを確認するテストケースを作成。

関連Issue は #171

Copy link
Contributor Author

@akiyamaa-cnt akiyamaa-cnt left a comment

Choose a reason for hiding this comment

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

@nishimotz
0030-01 ままで良いかなと思ったのですが、少し細かく手を入れました。
以下、変更箇所に対してざっくりコメントを記載しています。

変更箇所のうち、少し細かいのですが次の 2点については、2月の WG 内で相談させてください。

  • ラジオボタングループに対する required 属性の指定方法
    • グループ内の 1つのラジオボタンにのみ required 属性を指定する?
    • グループ内の全部のラジオボタンに required 属性を指定する?
  • 関連する達成方法がない場合ん記載方法


# テストのタイトル

required 属性による必須項目の特定(input要素、select要素、textarea要素)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

0030-01 では次のようになっていたので、"aria-required" 部分を "required" に置き換え。

aria-required 属性による必須項目の特定(input要素、select要素、textarea要素)


# テストの目的

required属性が設定された要素にフォーカスを移動した際、支援技術に必須であることが伝わることを確認する
Copy link
Contributor Author

Choose a reason for hiding this comment

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

0030-01 では次のようになっていたので、"aria-required" 部分を "required" に置き換え。

required属性が設定された要素にフォーカスを移動した際、支援技術に必須であることが伝わることを確認する


# 関連する達成方法 (複数)

なし
Copy link
Contributor Author

Choose a reason for hiding this comment

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

「required属性による必須項目の特定」を直接的に言及する達成方法が確認できなかったため「なし」と記載。

過去のテストケースでは、例えば WAIC-TEST-0027-01.md では「今のところなし」と記載。
同様にした方が良いか相談したいです。

Copy link
Contributor

Choose a reason for hiding this comment

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

  • 「今のところなし」と「なし」を積極的に使い分けてこなかった。
  • 「なし」を使うことの方が多い。


# 期待される結果 (音声閲覧環境)

required属性が設定された要素にフォーカスを移動した際、支援技術に必須であることが伝わる
Copy link
Contributor Author

Choose a reason for hiding this comment

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

0030-01 では次のようになっていたので、"aria-required" 部分を "required" に置き換え。

aria-required属性が設定された要素にフォーカスを移動した際、支援技術に必須であることが伝わる


# 関連する要素や属性

required 属性が指定されているinput 要素、select 要素、textarea 要素
Copy link
Contributor Author

Choose a reason for hiding this comment

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

0030-01 では次のようになっていたので、"aria-required" 部分を "required" に置き換え。

aria-required 属性が指定されているinput 要素、select 要素、textarea 要素

</head>

<body>
<h1>required属性による必須項目の特定</h1>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

0030-01 にはなかったですが、見出し構造を整えるために h1 を追加。

Comment on lines +19 to +20
<label for="usrname1">ログインネーム[*]</label>
<input type="text" name="usrname1" id="usrname1" required />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

テストには直接関係ないのですが、 id属性値やname属性値を調整しました。

「required属性が設定されている」「required属性が設定されていない」の2つのテストでの属性値の重複回避を、末尾数字が 1 と 2 で分けるようにしています。

Comment on lines +27 to +31
<label for="os_pc1">利用しているOS(PC)[*]</label>
<select id="os_pc1" name="os_pc1" required>
<option value="Windows">Windows</option>
<option value="macOS">macOS</option>
</select>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

select 要素の中に必須項目を示すテキストが含まれていたため、label 要素内の末尾へと移動しました。
あわせて、他の入力項目の必須項目を示すテキストも、同様に label 要素内の末尾に移動しています。

Copy link
Contributor

Choose a reason for hiding this comment

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

必須項目を示すテキスト = [*]

Comment on lines +41 to +47
<fieldset>
<legend>スクリーンリーダーの利用状況</legend>
<input type="radio" id="yes1" name="sr1" value="1" required />
<label for="yes1">利用している[*]</label>
<input type="radio" id="no1" name="sr1" value="2" required />
<label for="no1">利用していない[*]</label>
</fieldset>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fieldset 要素に aria-required 属性が指定されていたので、input要素への指定へと変更しました。

ラジオボタングループへの required 属性の指定方法について相談したいです。
2つのラジオボタンに required 属性を設定する必要があるか悩んだのですが、MDN では以下のように記載されていたので、2つのラジオボタンに required 属性を設定しています。

https://developer.mozilla.org/ja/docs/Web/HTML/Attributes/required

同じ名前が付けられた radio ボタンのグループのでは、グループ内の一つのラジオボタンに required 属性が設定されていた場合、この属性が設定されているものでなくても構わないのですが、グループ内のラジオボタンの一つをチェックする必要があります。コードの保守性を向上させるために、グループ内の同じ名前のラジオボタンすべてに required 属性を設定するか、またはどれにも設定しないようにすることをお勧めします。

Copy link
Contributor

Choose a reason for hiding this comment

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

  • 仕様上はどれかが必須になれば、グループ全体が必須になる
  • 「保守性」と言っているが、その要素だけ特別扱いのように見えることの懸念では?
  • このままでいいのでは

@akiyamaa-cnt akiyamaa-cnt self-assigned this Feb 5, 2025
@@ -0,0 +1,157 @@
# テスト ID

WAIC-TEST-0030-01
Copy link
Contributor

Choose a reason for hiding this comment

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

0037-01 に直す

@nishimotz
Copy link
Contributor

  • 確認してマージする

Copy link
Contributor Author

@akiyamaa-cnt akiyamaa-cnt left a comment

Choose a reason for hiding this comment

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

@nishimotz
テストID を修正いたしました。

Comment on lines +1 to +3
# テスト ID

WAIC-TEST-0037-01
Copy link
Contributor Author

Choose a reason for hiding this comment

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

テストID を 0037-01 へと修正。

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.

2 participants