Skip to content
Open
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
14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE/ACCESSIBILITY_SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ assignees: ''

- ... List the rules here, link to its acc support section

## Test cases
## Examples

### Test case 1 ...
### Example 1 ...

(( Add test case here ))
(( Add example here ))

```html
code snippet here
```

[Open this test case]()
[Open this example]()

(( Add a link to a code pen or other hosted test case. Keep in mind this test case needs to be accessible and persistent. ))
(( Add a link to a code pen or other hosted example. Keep in mind this example needs to be accessible and persistent. ))

#### Preconditions

Expand All @@ -39,12 +39,12 @@ Before running the test, check your settings. In many cases default settings are

#### Test instructions

(( Provide instructions on how to test the test case, this should include: ))
(( Provide instructions on how to test the example, this should include: ))

- Which technologies to use
- Any setting changes necessary to run the test
- Any variation in how to operate the different assistive technologies
- Step by step instructions on how to check the test case
- Step by step instructions on how to check the example
- What the expected results are

### External links
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Need for Call for Review:
<< check [Process Document on Call for Review](https://act-rules.github.io/pages/design/process/#call-for-review) >>
This can be merged with 1 approval << choose reason: editorial changes to website/test code, adding new contributor, other (explain). >>
This will not require a Call for Review << choose reason(s): editorial changes (including to the applicability, expectation or examples section), changes to assumptions, background, accessibility support, change to website/test code (not rule), other (explain). >>
This will require a 1 week Call for Review << small changes affecting a small number of test cases, if in doubt do not use this. >>
This will require a 2 weeks Call for Review << new rule, or substantial changes affecting a large number of test cases, if in doubt, use this. >>
This will require a 1 week Call for Review << small changes affecting a small number of examples, if in doubt do not use this. >>
This will require a 2 weeks Call for Review << new rule, or substantial changes affecting a large number of examples, if in doubt, use this. >>

---

Expand Down
22 changes: 11 additions & 11 deletions .github/scripts/approve-rule.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (!argv['skip-clone']) {
await createOrCheckoutBranch(config, argv.branch);
await generateApprovedRulePages(config, argv.ruleId);
await updateRuleVersionsYaml(config, argv.ruleId);
await approveTestCaseJson(config, argv.ruleId);
await approveexampleJson(config, argv.ruleId);
await commitAndPush(config, `Set ${argv.ruleId} to approved`);

async function generateApprovedRulePages({ tmpDir, rulesDir, glossaryDir, testAssetsDir }, ruleId) {
Expand Down Expand Up @@ -67,17 +67,17 @@ async function updateRuleVersionsYaml({ tmpDir }, ruleId) {
console.log(`Added ${ruleId} to rule-versions.yml`);
}

async function approveTestCaseJson({ tmpDir }, ruleId) {
let testCaseCount = 0;
const testCaseJsonPath = `${tmpDir}content-assets/wcag-act-rules/testcases.json`;
const testCaseJson = JSON.parse(fs.readFileSync(testCaseJsonPath, 'utf8'));
testCaseJson.testcases.forEach((testCase, index) => {
if (testCase.ruleId === ruleId) {
async function approveexampleJson({ tmpDir }, ruleId) {
let exampleCount = 0;
const exampleJsonPath = `${tmpDir}content-assets/wcag-act-rules/examples.json`;
const exampleJson = JSON.parse(fs.readFileSync(exampleJsonPath, 'utf8'));
exampleJson.examples.forEach((example, index) => {
if (example.ruleId === ruleId) {
// Override rather than update so that `approved` isn't at the bottom
testCaseJson.testcases[index] = { ruleId, approved: true, ...testCase }
testCaseCount++
exampleJson.examples[index] = { ruleId, approved: true, ...example }
exampleCount++
}
});
console.log(`Set ${testCaseCount} test cases of rule ${ruleId} to be approved in testcases.json`);
fs.writeFileSync(testCaseJsonPath, JSON.stringify(testCaseJson, null, 2), 'utf8');
console.log(`Set ${exampleCount} examples of rule ${ruleId} to be approved in examples.json`);
fs.writeFileSync(exampleJsonPath, JSON.stringify(exampleJson, null, 2), 'utf8');
}
4 changes: 2 additions & 2 deletions .github/scripts/pr-preview.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { config, cloneWcagActRules, commitAndPush } from './commons.mjs'

await cloneWcagActRules(config);
await generateProposedRulePages(config);
await generateTestCases(config);
await generateexamples(config);
// const commitMessage = (await $`git log -1 --pretty=%B`).stdout;
// await commitAndPush(config, commitMessage);

Expand All @@ -18,7 +18,7 @@ async function generateProposedRulePages({ tmpDir, rulesDir, glossaryDir, testAs
`;
}

async function generateTestCases({ tmpDir, rulesDir, testAssetsDir }) {
async function generateexamples({ tmpDir, rulesDir, testAssetsDir }) {
await $`node ./node_modules/act-tools/dist/cli/build-examples.js \
--rulesDir "${rulesDir}" \
--testAssetsDir "${testAssetsDir}" \
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/wai-build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { config, cloneWcagActRules, commitAndPush } from './commons.mjs'

await cloneWcagActRules(config);
await generateProposedRulePages(config);
await generateTestCases(config);
await generateexamples(config);
const commitMessage = (await $`git log -1 --pretty=%B`).stdout;
await commitAndPush(config, commitMessage);

Expand All @@ -18,7 +18,7 @@ async function generateProposedRulePages({ tmpDir, rulesDir, glossaryDir, testAs
`;
}

async function generateTestCases({ tmpDir, rulesDir, testAssetsDir }) {
async function generateexamples({ tmpDir, rulesDir, testAssetsDir }) {
await $`node ./node_modules/act-tools/dist/cli/build-examples.js \
--rulesDir "${rulesDir}" \
--testAssetsDir "${testAssetsDir}" \
Expand Down
2 changes: 1 addition & 1 deletion __deprecated__/pages/contribute/rule-feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To start giving feedback and doing reviews for draft rules:

We also welcome any feedback and suggestions for changes to already published rules. The published rules should be as precise as possible, limiting the number of potential false positives and false negatives. For this, it is important to draw on as many tool and methodology implementations and expert opinions as possible.

Feedback and corrections for existing rules can target any of the sections of the rule itself (Applicability, Expectations, Accessibility Support, etc.), as well as the test cases, for example to expand the edge case coverage.
Feedback and corrections for existing rules can target any of the sections of the rule itself (Applicability, Expectations, Accessibility Support, etc.), as well as the examples, for instance to expand the edge case coverage.

You have several options for correcting existing rules:

Expand Down
2 changes: 1 addition & 1 deletion __tests__/spelling-ignore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
- 4E00–9FFF

# JSON attributes/ metadata/ methods
- testcases
- examples
- ruleId
- ruleName
- rulePage
Expand Down
29 changes: 29 additions & 0 deletions _rules/__tests__/example-has-heading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const describeRule = require('../../test-utils/describe-rule')
const getMarkdownAstNodesOfType = require('../../utils/get-markdown-ast-nodes-of-type')

describeRule('example has heading', ({ filename, markdownAST }) => {
/**
* get all headings of examples (eg: #### Failed Example 1)
*/
const exampleHeadings = getMarkdownAstNodesOfType(markdownAST, 'heading')
.filter(({ depth, children }) => {
return depth === 4 && children && children.length > 0
})
.map(({ children }) => {
const [textNode] = children
return textNode.value
})

/**
* get code blocks in markdown body
*/
const exampleCodeSnippets = getMarkdownAstNodesOfType(markdownAST, 'code')

/**
* Check if filename has `id` as a part of the name
*/
test('each example has a heading', () => {
const msg = `Not all examples have headings in ${filename}.`
expect(exampleHeadings.length, msg).toBe(exampleCodeSnippets.length)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const htmlHintRules = {
'empty-tag-not-self-closed': false,
}

describeRule('testcases', ruleData => {
describeRule('examples', ruleData => {
const { frontmatter, body } = ruleData
const { id, name, htmlHintIgnore = [] } = frontmatter

Expand Down
2 changes: 1 addition & 1 deletion _rules/__tests__/headings.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describeRule('headings', ruleData => {
/**
* Check for `required` `h2` headings
*/
const requiredH2 = [`Applicability`, `Background`, `Test Cases`]
const requiredH2 = [`Applicability`, `Background`, `Examples`]
const h2Headings = getHeadingOfDepth(headings, 2)
test.each(requiredH2)('has required `h2` - `%s`', heading => {
expect(h2Headings).toContain(heading)
Expand Down
29 changes: 0 additions & 29 deletions _rules/__tests__/testcase-has-heading.js

This file was deleted.

2 changes: 1 addition & 1 deletion _rules/aria-attr-defined-5f99a7.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ There are no accessibility support issues known.
- [Understanding Success Criterion 4.1.2: Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value)
- [Semantics and ARIA](https://developers.google.com/web/fundamentals/accessibility/semantics-aria/)

## Test Cases
## Examples

### Passed

Expand Down
2 changes: 1 addition & 1 deletion _rules/aria-hidden-no-focusable-content-6cfa84.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Some user agents treat the value of `aria-hidden` attribute as case-sensitive.
- [Fourth rule of ARIA use](https://www.w3.org/TR/using-aria/#fourth)
- [Element with presentational children has no focusable content](presentational-children-no-focusable-content-307n5z.md)

## Test Cases
## Examples

### Passed

Expand Down
6 changes: 3 additions & 3 deletions _rules/aria-required-context-role-ff89c9.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This rule is restricted to direct parent-child relation in the [accessibility tr

[Subclass roles][subclass role] of [required context roles][] are not automatically included as possible [required context roles][]. For example, the [`feed`](https://www.w3.org/TR/wai-aria-1.2/#feed) role is not a possible [required context role][] for [`listitem`](https://www.w3.org/TR/wai-aria-1.2/#listitem), even though [`feed`](https://www.w3.org/TR/wai-aria-1.2/#feed) is a [subclass role][] of the [`list`](https://www.w3.org/TR/wai-aria-1.2/#list) role.

Some user agents try to correct missing [required context roles][] or incorrect [content model][]. This often results, for example, in an isolated list item being presented as part of a one-item list containing only itself. Therefore, most test cases contain several targets to try and circumvent these corrections in order to better demonstrate the issue.
Some user agents try to correct missing [required context roles][] or incorrect [content model][]. This often results, for example, in an isolated list item being presented as part of a one-item list containing only itself. Therefore, most examples contain several targets to try and circumvent these corrections in order to better demonstrate the issue.

### Assumptions

Expand All @@ -63,7 +63,7 @@ The rule assumes that the [explicit role][] of the applicable elements is approp
- [Understanding Success Criterion 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html)
- [Required Context Role][]

## Test Cases
## Examples

### Passed

Expand All @@ -80,7 +80,7 @@ These elements with an [explicit role][] of `listitem` are children in the [acce

#### Passed Example 2

These elements with an [explicit role][] of `listitem` are children in the [accessibility tree][] of an element with their [required context role][], `list`, expressed as an [implicit role][] of `ul`. Note that this test case does not satisfy [Success Criterion 4.1.1 Parsing][sc411] because the [`ul` element][ul] does not respect its [content model][].
These elements with an [explicit role][] of `listitem` are children in the [accessibility tree][] of an element with their [required context role][], `list`, expressed as an [implicit role][] of `ul`. Note that this example does not satisfy [Success Criterion 4.1.1 Parsing][sc411] because the [`ul` element][ul] does not respect its [content model][].

```html
<ul>
Expand Down
2 changes: 1 addition & 1 deletion _rules/aria-required-id-references-in6db8.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Some user agents treat the value of `aria-*` attribute as case-sensitive (even w
- [WAI-ARIA required states and properties](https://www.w3.org/TR/wai-aria-1.2/#requiredState)
- [RFC 3986](https://www.ietf.org/rfc/rfc3986.txt)

## Test Cases
## Examples

### Passed

Expand Down
6 changes: 3 additions & 3 deletions _rules/aria-required-owned-element-bc4a75.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If the [semantic role][] on the target element is incorrectly used, and any rela
- [Required Owned Element](https://www.w3.org/TR/wai-aria-1.2/#mustContain)
- [Owned Element](https://www.w3.org/TR/wai-aria-1.2/#dfn-owned-element)

## Test Cases
## Examples

### Passed

Expand Down Expand Up @@ -116,7 +116,7 @@ This element with the `tablist` role only owns elements with the `tab` role. The

This element with the `list` role only owns elements with the `listitem` role through the `aria-owns` attribute. The `listitem` role is one of the [required owned elements][] for `list`.

**Note:** This test case follows the definition of [owned by][]. If implemented differently, this definition could cause differences in outcome of this test case.
**Note:** This example follows the definition of [owned by][]. If implemented differently, this definition could cause differences in outcome of this example.

```html
<div role="list" aria-owns="id1"></div>
Expand Down Expand Up @@ -238,7 +238,7 @@ This element with the `grid` role only owns elements with the `row` role, but th

This element with the `list` role owns an element with the `tab` role through the `aria-owns` attribute. The `tab` role is not one of the [required owned elements][] for `list`.

**Note:** This test case follows the definition of [owned by][]. If implemented differently, this definition could cause differences in outcome of this test case.
**Note:** This example follows the definition of [owned by][]. If implemented differently, this definition could cause differences in outcome of this example.

```html
<div role="list" aria-owns="id2"></div>
Expand Down
2 changes: 1 addition & 1 deletion _rules/aria-state-or-property-permitted-5c01ea.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Implementation of [Presentational Roles Conflict Resolution][] varies from one b
- [ARIA5: Using WAI-ARIA state and property attributes to expose the state of a user interface component](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA5)
- [Document conformance requirements for use of ARIA attributes in HTML](https://www.w3.org/TR/html-aria/#docconformance)

## Test Cases
## Examples

### Passed

Expand Down
2 changes: 1 addition & 1 deletion _rules/aria-state-or-property-valid-value-6a7281.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Some user agents treat the value of `aria-*` attribute as case-sensitive (even w
- [WAI-ARIA 1.2, Characteristics of States and Properties, Value](https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value)
- [Uniform Resource Identifier (URI): Generic Syntax (RFC 3986)](https://www.ietf.org/rfc/rfc3986.txt)

## Test Cases
## Examples

### Passed

Expand Down
2 changes: 1 addition & 1 deletion _rules/attr-not-duplicated-e6952f.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ There are no accessibility support issues known.

- [H94: Ensuring that elements do not contain duplicate attributes](https://www.w3.org/WAI/WCAG22/Techniques/html/H94)

## Test Cases
## Examples

### Passed

Expand Down
2 changes: 1 addition & 1 deletion _rules/audio-as-media-alternative-afb423.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ There are no accessibility support issues known.

- [Understanding SC 1.2.1: Audio-only and Video-only (Prerecorded)](https://www.w3.org/WAI/WCAG22/Understanding/audio-only-and-video-only-prerecorded)

## Test Cases
## Examples

### Passed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ User agents do not always automatically play media, even when an `autoplay` attr
- [Understanding Success Criterion 1.4.2: Audio Control](https://www.w3.org/WAI/WCAG22/Understanding/audio-control.html)
- [Accessible Multimedia](https://developer.mozilla.org/en-US/docs/Learn/Accessibility/Multimedia)

## Test Cases
## Examples

### Passed

Expand Down
2 changes: 1 addition & 1 deletion _rules/audio-text-alternative-e7aa44.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ There are no accessibility support issues known.
- [Understanding SC 1.2.1: Audio-only and Video-only (Prerecorded)](https://www.w3.org/WAI/WCAG22/Understanding/audio-only-and-video-only-prerecorded)
- [G158: Providing an alternative for time-based media for audio-only content](https://www.w3.org/WAI/WCAG22/Techniques/general/G158)

## Test Cases
## Examples

### Passed

Expand Down
2 changes: 1 addition & 1 deletion _rules/audio-transcript-2eb176.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ There are no accessibility support issues known.
- [Understanding SC 1.2.1:Audio-only and Video-only (Prerecorded)](https://www.w3.org/WAI/WCAG22/Understanding/audio-only-and-video-only-prerecorded)
- [G158: Providing an alternative for time-based media for audio-only content](https://www.w3.org/WAI/WCAG22/Techniques/general/G158)

## Test Cases
## Examples

### Passed

Expand Down
2 changes: 1 addition & 1 deletion _rules/auto-play-audio-does-not-exceed-3-seconds-aaa1bf.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ There are no accessibility support issues known.
- [G60: Playing a sound that turns off automatically within three seconds](https://www.w3.org/WAI/WCAG22/Techniques/general/G60)
- [G171: Playing sounds only on user request](https://www.w3.org/WAI/WCAG22/Techniques/general/G171)

## Test Cases
## Examples

### Passed

Expand Down
2 changes: 1 addition & 1 deletion _rules/auto-play-audio-has-control-mechanism-4c31df.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The native `video` and `audio` controls in several browser and assistive technol
- [Failure of Success Criterion 1.4.2 for absence of a way to pause or stop an HTML5 media element that autoplays](https://www.w3.org/WAI/WCAG22/Techniques/failures/F93)
- [G170: Providing a control near the beginning of the Web page that turns off sounds that play automatically](https://www.w3.org/WAI/WCAG22/Techniques/general/G170)

## Test Cases
## Examples

### Passed

Expand Down
2 changes: 1 addition & 1 deletion _rules/auto-update-text-efbfc7.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ There are no accessibility support issues known.
- [G186: Using a control in the Web page that stops moving, blinking, or auto-updating content][g186]
- [F16: Failure of Success Criterion 2.2.2 due to including scrolling content where movement is not essential to the activity without also including a mechanism to pause and restart the content][f16]

## Test Cases
## Examples

### Passed

Expand Down
2 changes: 1 addition & 1 deletion _rules/autocomplete-valid-value-73f2c2.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The purpose of a control is programmatically identifiable even when its `autocom
- [Definition: programmatically determined (programmatically determinable)](https://www.w3.org/TR/WCAG22/#dfn-programmatically-determinable)
- [Autofill](https://html.spec.whatwg.org/#autofill)

## Test Cases
## Examples

### Passed

Expand Down
Loading