Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/aria/fake-alert/data/assertions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
assertionId,priority,assertionStatement,assertionPhrase,refIds
roleAlert,3,Fake:Role 'alert' is conveyed,convey role 'alert',alert
textHello,1,Fake:Text 'Hello' is conveyed,convey text 'Hello',alert
5 changes: 5 additions & 0 deletions tests/aria/fake-alert/data/jaws-commands.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
testId,command,settings,assertionExceptions,presentationNumber
triggerAlert,space,virtualCursor,,1.0
triggerAlert,enter,virtualCursor,,1.1
triggerAlert,space,pcCursor,,2.0
triggerAlert,enter,pcCursor,,2.1
2 changes: 2 additions & 0 deletions tests/aria/fake-alert/data/js/setFocusOnButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// sets focus on the 'Trigger Alert' button
testPageDocument.querySelector('#alert-trigger').focus();
5 changes: 5 additions & 0 deletions tests/aria/fake-alert/data/nvda-commands.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
testId,command,settings,assertionExceptions,presentationNumber
triggerAlert,space,browseMode,,1.0
triggerAlert,enter,browseMode,,1.1
triggerAlert,space,focusMode,,2.0
triggerAlert,enter,focusMode,,2.1
8 changes: 8 additions & 0 deletions tests/aria/fake-alert/data/references.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
refId,type,value,linkText
author,metadata,Isabel Del Castillo,
authorEmail,metadata,isa.delcastillo5@gmail.com,
title,metadata,Fake Alert,
reference,metadata,reference/2022-4-8_144013/alert.html,Test Case Page for Alert Example
designPattern,metadata,https://www.w3.org/WAI/ARIA/apg/patterns/alert/,APG Pattern: Alert
example,metadata,https://www.w3.org/WAI/ARIA/apg/patterns/alert/examples/alert/,APG Example: Alert
alert,aria,alert,alert
2 changes: 2 additions & 0 deletions tests/aria/fake-alert/data/scripts.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setupScript,setupScriptDescription
setFocusOnButton,sets focus on the 'Trigger Alert' button
2 changes: 2 additions & 0 deletions tests/aria/fake-alert/data/tests.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
testId,title,presentationNumber,setupScript,instructions,assertions
triggerAlert,Trigger an alert,3,setFocusOnButton,"Starting at the 'Trigger Alert' button, activate the button to trigger the alert.",roleAlert textHello
4 changes: 4 additions & 0 deletions tests/aria/fake-alert/data/voiceover_macos-commands.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testId,command,settings,assertionExceptions,presentationNumber
triggerAlert,ctrl+opt+space,,,3.0
triggerAlert,space,,,3.1
triggerAlert,enter,,,3.2
37 changes: 37 additions & 0 deletions tests/aria/fake-alert/reference/2022-4-8_144013/alert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Alert Example</title>

<!-- js and css for this example. -->
<link href="css/alert.css" rel="stylesheet">
<script src="js/alert.js" type="text/javascript"></script>
</head>
<body>
<main>
<h1>Alert Example</h1>
<p>
The below example demonstrates the <a href="https://w3c.github.io/#alert">design pattern for alert</a>.
Activating the <q>Trigger Alert</q> button causes a message to be inserted into the example alert element.
</p>
<section>
<div class="example-header">
<h2 id="ex_label">Example</h2>
</div>
<div role="separator" id="ex_start_sep" aria-labelledby="ex_start_sep ex_label" aria-label="Start of"></div>
<div id="ex1">
<button type="button" id="alert-trigger">Trigger Alert</button>

<div id="example" role="alert"></div>

<!-- The following script element contains the content that will be inserted into the alert element. -->
<script type="text/template" id="alert-template">
<p>Hello</p>
</script>
</div>
<div role="separator" id="ex_end_sep" aria-labelledby="ex_end_sep ex_label" aria-label="End of"></div>
</section>
</main>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Alert Example</title>

<!-- js and css for this example. -->
<link href="css/alert.css" rel="stylesheet">
<script src="js/alert.js" type="text/javascript"></script>

<!-- Generated by process-test-directory.js -->
<script>
(function() {
function setupScript(testPageDocument) {
// setFocusOnButton
// sets focus on the 'Trigger Alert' button
testPageDocument.querySelector('#alert-trigger').focus();

};
document.addEventListener('click', function(event) {
if (event.target.classList.contains('button-run-test-setup')) {
event.target.disabled = true;
setupScript(document);
}
});
})();
</script>
<!-- End of generated output --></head>
<body>
<main>
<h1>Alert Example</h1>
<p>
The below example demonstrates the <a href="https://w3c.github.io/#alert">design pattern for alert</a>.
Activating the <q>Trigger Alert</q> button causes a message to be inserted into the example alert element.
</p>
<section>
<div class="example-header">
<h2 id="ex_label">Example</h2>
</div>
<div role="separator" id="ex_start_sep" aria-labelledby="ex_start_sep ex_label" aria-label="Start of"></div>
<div id="ex1">
<button type="button" id="alert-trigger">Trigger Alert</button>

<div id="example" role="alert"></div>

<!-- The following script element contains the content that will be inserted into the alert element. -->
<script type="text/template" id="alert-template">
<p>Hello</p>
</script>
</div>
<div role="separator" id="ex_end_sep" aria-labelledby="ex_end_sep ex_label" aria-label="End of"></div>
</section>

<!-- Generated by process-test-directory.js -->
<div style="position: relative; left: 0; right: 0; height: 2rem;">
<button class="button-run-test-setup" autofocus style="height: 100%; width: 100%;">Run Test Setup</button>
</div>
<!-- End of generated output --></main>
</body>
</html>
10 changes: 10 additions & 0 deletions tests/aria/fake-alert/reference/2022-4-8_144013/css/alert.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[role="alert"] {
padding: 10px;
border: 2px solid hsl(206deg 74% 54%);
border-radius: 4px;
background: hsl(206deg 74% 90%);
}

[role="alert"]:empty {
display: none;
}
29 changes: 29 additions & 0 deletions tests/aria/fake-alert/reference/2022-4-8_144013/js/alert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* This content is licensed according to the W3C Software License at
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
*/

'use strict';

window.addEventListener('load', function () {
var button = document.getElementById('alert-trigger');

button.addEventListener('click', addAlert);
});

/*
* @function addAlert
*
* @desc Adds an alert to the page
*
* @param {object} event - Standard W3C event object
*
*/

function addAlert() {
var example = document.getElementById('example');
var template = document.getElementById('alert-template').innerHTML;

example.innerHTML = template;
}
Loading