The following are a few tests for the role attribute.
This tests ensures that the role attribute is conveyed. The button role was selected since it is known to be widely supported. To pass, the element must be conveyed as a button in screen readers and actionable in voice control software.
This tests ensures that fallback roles are supported. A nonsensical role was selected as the first value since it should never be supported, and the button role was selected as a fallback role since it is known to be widely supported. To pass, the element must be conveyed as a button in screen readers and actionable in voice control software.
This tests ensures that changes to the role are processed. The image role was chosen for the initial role since it is known to be widely supported, and the button role was selected as the new dynamic role since it is also known to be widely supported. The role should be changed 1 second after page load and a success message will display under the button when the role has changed.
For screen readers: to pass, the element must be conveyed as a button after the role has been changed.
For voice control: to pass, the element must be actionable, either though the command to click a role name or by the show numbers command.
The containing role begins as 'note' and changes to 'region'. The testing procedure follows:
test start
wait here
target text
End tests