Skip to content

Instantly share code, notes, and snippets.

@mlewand
Last active August 29, 2015 14:11
Show Gist options
  • Save mlewand/544d6b596ec373296e89 to your computer and use it in GitHub Desktop.
Save mlewand/544d6b596ec373296e89 to your computer and use it in GitHub Desktop.
Quail tests overview.

All Tests

This file lists all tests in Quial.

aAdjacentWithSameResourceShouldBeCombined (custom, 1)

Adjacent links that point to the same location should be merged

See source.

WCAG techniques: H2,F89

aImgAltNotRepetitive (custom, 1)

When an image is in a link, its "alt" attribute should not repeat other text in the link

See source.

WCAG techniques: H30

aLinkTextDoesNotBeginWithRedundantWord (custom, 0)

Link text should not begin with redundant text

See source.

WCAG techniques: F84

aLinksAreSeparatedByPrintableCharacters (custom, 1)

Lists of links should be seperated by printable characters

See source.

aLinksDontOpenNewWindow (custom, 1)

Links should not open a new window without warning

See source.

WCAG techniques: H83,SCR24

aLinksNotSeparatedBySymbols (custom, 1)

Links should not be separated by symbols alone

See source.

aLinksToMultiMediaRequireTranscript (selector, 0)

Any links to a multimedia file should also include a link to a transcript

Selectors: a[href$='.wmv'], a[href$='.mpg'], a[href$='.mov'], a[href$='.ram'], a[href$='.aif']

WCAG techniques: G74

aLinksToSoundFilesNeedTranscripts (selector, 0)

Any links to a sound file should also include a link to a transcript

Selectors: a[href$='.wav'], a[href$='.snd'], a[href$='.mp3'], a[href$='.iff'], a[href$='.svx'], a[href$='.sam'], a[href$='.smp'], a[href$='.vce'], a[href$='.vox'], a[href$='.pcm'], a[href$='.aif']

WCAG techniques: G74

aLinkWithNonText (custom, undefined)

Links with only non-text content should be readable

See source.

WCAG techniques: H2,F89

aMultimediaTextAlternative (selector, 0)

No title

Selectors: a[href$='.wmv'], a[href$='.wav'], a[href$='.mpg'], a[href$='.mov'], a[href$='.ram'], a[href$='.aif']

aMustContainText (custom, 1)

Links should contain text

See source.

WCAG techniques: H30,H91

aMustHaveTitle (selector, 1)

All links must have a "title" attribute

Selectors: a:not(a[title])

aMustNotHaveJavascriptHref (selector, 1)

Links should not use "javascript" in their location

Selectors: a[href^='javascript:']

aSuspiciousLinkText (custom, 1)

Link text should be useful

See source.

WCAG techniques: H30

aTitleDescribesDestination (selector, 0)

The title attribute of all source a (anchor) elements describes the link destination.

Selectors: a[title]

WCAG techniques: H33,H25

addressForAuthor (selector, 1)

The document should contain an address for the author

Selectors: body:not(body:has(address))

addressForAuthorMustBeValid (selector, 0.5)

The document should contain a valid email address for the author

Selectors: address

appletContainsTextEquivalent (custom, 1)

All applets should contain the same content within the body of the applet

See source.

WCAG techniques: G74,H35

appletContainsTextEquivalentInAlt (placeholder, 0.5)

All applets should contain a text equivalent in the "alt" attribute

WCAG techniques: G74,H35

appletProvidesMechanismToReturnToParent (selector, 0)

All applets should provide a way for keyboard users to escape

Selectors: applet

appletTextEquivalentsGetUpdated (selector, 0)

No title

Selectors: applet

WCAG techniques: G74,H35

appletUIMustBeAccessible (selector, 0)

Any user interface in an applet must be accessible

Selectors: applet

WCAG techniques: G74,H35

appletsDoNotFlicker (selector, 0)

All applets do not flicker

Selectors: applet

WCAG techniques: F7

appletsDonotUseColorAlone (selector, 0)

Applets should not use color alone to communicate content

Selectors: applet

areaAltIdentifiesDestination (selector, 0)

All "area" elements must have an "alt" attribute which describes the link destination

Selectors: area[alt]

WCAG techniques: G74

areaAltRefersToText (selector, 0)

Alt text for "area" elements should replicate the text found in the image

Selectors: area

areaDontOpenNewWindow (selector, 1)

No "area" elements should open a new window without warning

Selectors: area[target='new window'], area[target=_new], area[target=_blank], area[target=_blank]

areaHasAltValue (selector, 1)

All "area" elements must have an "alt" attribute

Selectors: area:not(area[alt])

WCAG techniques: F65,G74,H24,G145

areaLinksToSoundFile (selector, 1)

All "area" elements which link to a sound file should also provide a link to a transcript

Selectors: area[href$=wav], area[href$=snd], area[href$=mp3], area[href$=iff], area[href$=svx], area[href$=sam], area[href$=smp], area[href$=vce], area[href$=vox], area[href$=pcm], area[href$=aif]

WCAG techniques: G74

ariaOrphanedContent (custom, 1)

Pages using ARIA roles should not have orphaned content

See source.

basefontIsNotUsed (selector, 1)

Basefont should not be used

Selectors: basefont

blinkIsNotUsed (selector, 1)

The "blink" tag should not be used

Selectors: blink

WCAG techniques: F47

blockquoteNotUsedForIndentation (selector, 0.5)

The "blockquote" tag should not be used just for indentation

Selectors: blockquote:not(blockquote[cite])

WCAG techniques: H49

blockquoteUseForQuotations (custom, 0.5)

If long quotes are in the document, use the "blockquote" element to mark them

See source.

WCAG techniques: H49

boldIsNotUsed (selector, 1)

The "b" (bold) element is not used

Selectors: bold

buttonHasValue (placeholder, 1)

Button should contain text

WCAG techniques: H91

checkboxHasLabel (label, 1)

All checkboxes must have a corresponding label

WCAG techniques: H44,F68,H91

checkboxLabelIsNearby (labelProximity, 0.5)

All "checkbox" input elements have a label that is close

closingTagsAreUsed (custom, 1)

All tags that require closing tags have closing tags

See source.

WCAG techniques: H74

contentPositioningShouldNotChangeMeaning (custom, 0.5)

Meaning should not be created through positioning

See source.

WCAG techniques: C6,F1,G57

cssDocumentMakesSenseStyleTurnedOff (selector, 0)

The document must be readable with styles turned off

Selectors: link[rel=stylesheet], stylesheet, *[style]

WCAG techniques: G140

cssTextHasContrast (color, 1)

All elements should have appropriate color contrast

WCAG techniques: G18

definitionListsAreUsed (custom, 0.5)

Use a definition list for defining terms

See source.

WCAG techniques: H48

doctypeProvided (custom, 1)

The document should contain a valid "doctype" declaration

See source.

documentAbbrIsUsed (custom, 0.5)

Abbreviations must be marked with an "abbr" element

See source.

WCAG techniques: H28

documentAcronymsHaveElement (custom, 0.5)

Acronyms must be marked with an "acronym" element

See source.

WCAG techniques: H28

documentAutoRedirectNotUsed (selector, 1)

Auto-redirect with "meta" elements must not be used

Selectors: meta[http-equiv=refresh]

documentContentReadableWithoutStylesheets (selector, 0)

Content should be readable without style sheets

Selectors: html:has(link[rel=stylesheet], style) body, body:has(*[style])

WCAG techniques: G140

documentHasTitleElement (selector, 1)

The document should have a title element

Selectors: html:not(html:has(title))

WCAG techniques: H25

documentIDsMustBeUnique (custom, 1)

All element "id" attributes must be unique

See source.

WCAG techniques: F77,H93

documentIsWrittenClearly (custom, 0.5)

The document should be written to the target audience and read clearly

See source.

WCAG techniques: G86

documentLangIsISO639Standard (custom, 1)

The document's language attribute should be a standard code

See source.

WCAG techniques: H57

documentLangNotIdentified (selector, 1)

The document must have a "lang" attribute

Selectors: html:not(html[lang])

documentMetaNotUsedWithTimeout (selector, 1)

Meta elements must not be used to refresh the content of a page

Selectors: meta[http-equiv=refresh]

WCAG techniques: F40,F41

documentReadingDirection (selector, 0.5)

Reading direction of text is correctly marked

Selectors: *[lang=he]:not(*[dir=rtl]), *[lang=ar]:not(*[dir=rtl])

WCAG techniques: H34

documentStrictDocType (custom, 1)

The page uses a strict doctype

See source.

documentTitleDescribesDocument (selector, 0)

The title describes the document

Selectors: head title:first

WCAG techniques: F25,G88

documentTitleIsNotPlaceholder (placeholder, 1)

The document title should not be placeholder text

WCAG techniques: F25,G88

documentTitleIsShort (custom, 0.5)

The document title should be short

See source.

documentTitleNotEmpty (placeholder, 1)

The document should not have an empty title

WCAG techniques: F25,H25

documentValidatesToDocType (custom, 1)

Document must validate to the doctype

See source.

WCAG techniques: G134

documentVisualListsAreMarkedUp (custom, 1)

Visual lists of items are marked using ordered or unordered lists

See source.

WCAG techniques: H28,H48,T2

domOrderMatchesVisualOrder (selector, 0.5)

Ensure that the visual order of the page matches the DOM

Selectors: *:quailCss(position=absolute), *:quailCss(position=fixed), *:quailCss(float=right), *:quailCss(float=left)

WCAG techniques: C27

elementAttributesAreValid (custom, 1)

Attributes should have spaces between them and be wrapped in quotes

See source.

embedHasAssociatedNoEmbed (custom, 1)

All "embed" elements have an associated "noembed" element

See source.

elementsDoNotHaveDuplicateAttributes (custom, 1)

Elements should not have duplicate attributes

See source.

embedMustHaveAltAttribute (selector, 1)

"Embed" elements must have an "alt" attribute

Selectors: embed:not([alt])

embedMustNotHaveEmptyAlt (selector, 1)

"Embed" elements cannot have an empty "alt" attribute

Selectors: embed[alt=]

embedProvidesMechanismToReturnToParent (selector, 0)

All embed elements should provide a way for keyboard users to escape

Selectors: embed

WCAG techniques: G21

emoticonsExcessiveUse (custom, 0.5)

Emoticons should not be used excessively

See source.

WCAG techniques: H86

emoticonsMissingAbbr (custom, 1)

Emoticons should have abbreviations

See source.

WCAG techniques: H86

fieldsetHasLabel (selector, 1)

Fieldsets require a label element

Selectors: fieldset:not(fieldset:has(legend))

WCAG techniques: H91

fileHasLabel (label, 1)

All "file" input elements have a corresponding label

WCAG techniques: H44,F68

fileLabelIsNearby (labelProximity, 0.5)

All "file" input elements have a label that is close

focusIndicatorVisible (custom, undefined)

Focus indicators have high visibility

See source.

WCAG techniques: C15,G165,G195

fontIsNotUsed (selector, 1)

Font elements should not be used

Selectors: font

formAllowsCheckIfIrreversable (selector, 0)

No title

Selectors: form

formButtonsHaveValue (selector, 1)

Input elements for button, submit, or reset must have a value attribute

Selectors: input[type=button]:not([value]), input[type=submit]:not([value]), input[type=reset]:not([value])

WCAG techniques: H91

formDeleteIsReversable (selector, 0)

Deleting items using a form should be reversable

Selectors: form

formErrorMessageHelpsUser (selector, 0)

Forms offer the user a way to check the results of their form before performing an irrevocable action

Selectors: form

formHasGoodErrorMessage (selector, 0)

Form error messages should assist in solving errors

Selectors: form

formHasSubmitButton (selector, 1)

Form should have a submit button

Selectors: form:not(form:has(input[type=image], input[type=submit], button[type=submit]))

WCAG techniques: H32,G80

formWithRequiredLabel (custom, 0)

Input items which are required are marked as so in the label element

See source.

WCAG techniques: ARIA2,F81,H90

frameIsNotUsed (selector, 1)

Frames are not used

Selectors: frame

frameRelationshipsMustBeDescribed (selector, 0.5)

Complex framesets should contain a "longdesc" attribute

Selectors: frameset:not(frameset[longdesc])

framesAreUsedToGroupContent (selector, 0.5)

Use frame elements to group repeated materials

Selectors: body:not(body:has(frameset))

WCAG techniques: H70

frameSrcIsAccessible (selector, 0)

The source for each frame is accessible content.

Selectors: frame

frameTitlesDescribeFunction (placeholder, 0)

All "frame" elements should have a "title" attribute that describes the purpose of the frame

WCAG techniques: H64

frameTitlesNotEmpty (selector, 1)

Frames cannot have empty "title" attributes

Selectors: frame:not(frame[title]), frame[title=''], iframe:not(iframe[title]), iframe[title='']

WCAG techniques: H64

frameTitlesNotPlaceholder (placeholder, 1)

Frames cannot have "title" attributes that are just placeholder text

WCAG techniques: H64

framesHaveATitle (selector, 1)

All "frame" elements should have a "title" attribute

Selectors: frame:not(frame[title]), iframe:not(iframe[title])

WCAG techniques: H64

framesetIsNotUsed (selector, 1)

The "frameset" element should not be used

Selectors: frameset

framesetMustHaveNoFramesSection (selector, 0.5)

All framesets should contain a noframes section

Selectors: frameset:not(frameset:has(noframes))

headerH1 (headingLevel, 0)

The header following an h1 is not h3 through h6

WCAG techniques: G130

headerH1Format (selector, 0)

All h1 elements are not used for formatting

Selectors: h1

WCAG techniques: T3

headerH2 (headingLevel, 0)

The header following an h2 is not h4, h5, or h6

WCAG techniques: G130

headerH2Format (selector, 0)

All h2 elements are not used for formatting

Selectors: h2

WCAG techniques: T3

headerH3 (headingLevel, 0)

The header following an h3 is not an h5 or h6

WCAG techniques: G130

headerH3Format (selector, 0)

All h3 elements are not used for formatting

Selectors: h3

WCAG techniques: T3

headerH4 (headingLevel, 0)

The header following an h4 is not an h6

WCAG techniques: G130

headerH4Format (selector, 0)

All h4 elements are not used for formatting

Selectors: h4

WCAG techniques: T3

headerH5Format (selector, 0)

All h5 elements are not used for formatting

Selectors: h5

WCAG techniques: T3

headerH6Format (selector, 0)

All h6 elements are not used for formatting

Selectors: h6

WCAG techniques: T3

headersHaveText (placeholder, 1)

All headers should contain readable text

WCAG techniques: G141

headersUsedToIndicateMainContent (custom, 0.5)

Use header to indicate start of main content

See source.

WCAG techniques: H69

headersUseToMarkSections (custom, 0.5)

Use headers to mark the beginning of each section

See source.

WCAG techniques: G141,H69

idRefHasCorrespondingId (custom, 1)

Elements with an idref attribute must correspond to an element with an ID

See source.

WCAG techniques: F17

iIsNotUsed (selector, 1)

The "i" (italic) element is not used

Selectors: i

iframeMustNotHaveLongdesc (selector, 1)

Inline frames ("iframes") should not have a "longdesc" attribute

Selectors: iframe[longdesc]

imageMapServerSide (selector, 1)

All links in a server-side map should have duplicate links available in the document

Selectors: img[ismap]

imgAltEmptyForDecorativeImages (selector, 0)

If an image is purely decorative, the "alt" text must be empty

Selectors: img[alt]

WCAG techniques: F26

imgAltIdentifiesLinkDestination (selector, 0)

Any image within a link must have "alt" text the describes the link destination

Selectors: a img[alt]:first

imgAltIsDifferent (custom, 0.5)

Image "alt" attributes should not be the same as the filename

See source.

WCAG techniques: H37

imgAltIsSameInText (selector, 0)

Check that any text within an image is also in the "alt" attribute

Selectors: img

WCAG techniques: G74,H37

imgAltIsTooLong (custom, 1)

Image Alt text is too long

See source.

WCAG techniques: H37

imgAltNotEmptyInAnchor (custom, 1)

An image within a link cannot have an empty "alt" attribute if there is no other text within the link

See source.

WCAG techniques: H30

imgAltNotPlaceHolder (placeholder, 1)

Images should not have a simple placeholder text as an "alt" attribute

WCAG techniques: F30,F39

imgAltTextNotRedundant (custom, 1)

Unless the image files are the same, no image should contain redundant alt text

See source.

imgGifNoFlicker (custom, 1)

Any animated GIF should not flicker

See source.

WCAG techniques: G152

imgHasAlt (selector, 1)

Image elements must have an "alt" attribute

Selectors: img:not(img[alt])

WCAG techniques: F65,H37

imgHasLongDesc (custom, 1)

A "longdesc" attribute is required for any image where additional information not in the "alt" attribute is required

See source.

WCAG techniques: G91

imgImportantNoSpacerAlt (custom, 0.5)

Images that are important should not have a purely white-space "alt" attribute

See source.

imgMapAreasHaveDuplicateLink (custom, 1)

All links within a client-side image are duplicated elsewhere in the document

See source.

imgNonDecorativeHasAlt (custom, 0.5)

Any non-decorative images should have a non-empty "alt" attribute

See source.

WCAG techniques: F38

imgNotReferredToByColorAlone (selector, 0)

For any image, the "alt" text cannot refer to color alone

Selectors: img

WCAG techniques: F13

imgServerSideMapNotUsed (selector, 1)

Server-side image maps should not be used

Selectors: img[ismap]

imgShouldNotHaveTitle (selector, 1)

Images should not have a "title" attribute

Selectors: img[title]

imgWithMapHasUseMap (selector, 1)

Any image with an "ismap" attribute have a valid "usemap" attribute

Selectors: img[ismap]:not(img[usemap])

imgWithMathShouldHaveMathEquivalent (custom, 0)

Images which contain math equations should provide equivalent MathML

See source.

inputCheckboxHasTabIndex (placeholder, 1)

All "checkbox" input elements require a valid "tabindex" attribute

inputCheckboxRequiresFieldset (custom, 1)

Logical groups of check boxes should be grouped with a fieldset

See source.

WCAG techniques: H71

inputDoesNotUseColorAlone (selector, 0)

An "input" element should not use color alone

Selectors: input:not(input[type=hidden])

inputElementsDontHaveAlt (selector, 1)

Input elements which are not images should not have an "alt" attribute

Selectors: input[type!=image][alt]

inputFileHasTabIndex (placeholder, 1)

All "file" input elements require a valid "tabindex" attribute

inputImageAltIdentifiesPurpose (selector, 0)

All "input" elements with a type of "image" must have an "alt" attribute that describes the function of the input

Selectors: input[type=image][alt]

WCAG techniques: H36

inputImageAltIsNotFileName (custom, 1)

All "input" elements with a type of "image" must have an "alt" attribute which is not the same as the filename

See source.

WCAG techniques: H36

inputImageAltIsNotPlaceholder (placeholder, 1)

All "input" elements with a type of "image" must have an "alt" attribute which is not placeholder text.

WCAG techniques: H36,H91

inputImageAltIsShort (custom, 1)

All "input" elements with a type of "image" must have an "alt" attribute which is as short as possible

See source.

WCAG techniques: H36

inputImageAltNotRedundant (custom, 1)

The "alt" text for input "image" submit buttons must not be filler text

See source.

WCAG techniques: H36

inputImageHasAlt (selector, 1)

All "input" elements with a type of "image" must have an "alt" attribute

Selectors: input[type=image]:not(input[type=image][alt])

WCAG techniques: F65,G94,H36,H91

inputImageNotDecorative (selector, 0)

The "alt" text for input "image" buttons must be the same as text inside the image

Selectors: input[type=image]

WCAG techniques: H36

inputPasswordHasTabIndex (placeholder, 1)

All "password" input elements require a valid "tabindex" attribute

inputRadioHasTabIndex (placeholder, 1)

All "radio" input elements require a valid "tabindex" attribute

inputSubmitHasTabIndex (placeholder, 1)

All "submit" input elements require a "tabindex" attribute

inputTextHasLabel (label, 1)

All "input" elements should have a corresponding "label"

WCAG techniques: H44,F68,H91

inputTextHasTabIndex (placeholder, 1)

All "text" input elements require a valid "tabindex" attribute

inputTextHasValue (placeholder, 1)

All "input" elements of type "text" must have a default text

inputTextValueNotEmpty (placeholder, 1)

Text input elements require a non-whitespace default text

inputWithoutLabelHasTitle (custom, 1)

Form controls without label should have a title attribute

See source.

WCAG techniques: H65

labelDoesNotContainInput (selector, 1)

Label elements should not contain an input element

Selectors: label:has(input)

labelMustBeUnique (custom, 1)

Every form input must have only one label

See source.

WCAG techniques: F17

labelMustNotBeEmpty (placeholder, 1)

Labels must contain text

WCAG techniques: H44,F68

labelsAreAssignedToAnInput (custom, 1)

All labels should be associated with an input

See source.

languageDirAttributeIsUsed (custom, 0.5)

Use the dir attribute when the language direction changes

See source.

WCAG techniques: H56

languageChangesAreIdentified (custom, 0.5)

Use language attributes to indicate changes in language

See source.

WCAG techniques: H58

languageDirectionPunctuation (custom, 0.5)

Place punctuation around language direction changes in the right order

See source.

WCAG techniques: G57

languageUnicodeDirection (custom, 1)

Use the unicode language direction

See source.

WCAG techniques: H34

legendDescribesListOfChoices (selector, 0)

All "legend" elements must describe the group of choices

Selectors: legend

WCAG techniques: G131

legendTextNotEmpty (selector, 1)

Legend text must not contain just whitespace

Selectors: legend:empty

WCAG techniques: H71,G131

legendTextNotPlaceholder (placeholder, 1)

"Legend" text must not contain placeholder text

WCAG techniques: H71,H91,G131

liDontUseImageForBullet (selector, 0.5)

No title

Selectors: li:has(img)

linkUsedForAlternateContent (selector, 0)

Use a "link" element for alternate content

Selectors: html:not(html:has(link[rel=alternate])) body

linkUsedToDescribeNavigation (selector, 1)

The document uses link elements to describe navigation if it is within a collection.

Selectors: html:not(html:has(link[rel=index]))

listNotUsedForFormatting (custom, 0)

Lists should not be used for formatting

See source.

WCAG techniques: F1

listOfLinksUseList (custom, 1)

A list of links separated by non-readable characters should be in an ul or ol

See source.

WCAG techniques: H48

marqueeIsNotUsed (selector, 1)

The "marquee" tag should not be used

Selectors: marquee

menuNotUsedToFormatText (selector, 0)

Menu elements should not be used for formatting

Selectors: menu:not(menu li:parent(menu))

newWindowIsOpened (custom, 1)

A link should not open a new window

See source.

WCAG techniques: H83

noembedHasEquivalentContent (selector, 0)

Noembed elements must be the same content as their "embed" element

Selectors: noembed

noframesSectionMustHaveTextEquivalent (selector, 0.5)

All "noframes" elements should contain the text content from all frames

Selectors: frameset:not(frameset:has(noframes))

objectContentUsableWhenDisabled (selector, 0)

When objects are disabled, content should still be available

Selectors: object

objectDoesNotFlicker (selector, 0)

Objects do not flicker

Selectors: object

WCAG techniques: F7

objectDoesNotUseColorAlone (selector, 0)

Objects must not use color to communicate alone

Selectors: object

objectInterfaceIsAccessible (selector, 0)

Interfaces within objects must be accessible

Selectors: object

objectLinkToMultimediaHasTextTranscript (selector, 0)

Objects which reference multimedia files should also provide a link to a transcript

Selectors: object

objectMustContainText (placeholder, 1)

Objects must contain their text equivalents

WCAG techniques: FLASH1,H27

objectMustHaveEmbed (selector, 1)

Every object should contain an "embed" element

Selectors: object:not(object:has(embed))

objectMustHaveTitle (selector, 1)

Objects should have a title attribute

Selectors: object:not(object[title])

WCAG techniques: H27

objectMustHaveValidTitle (placeholder, 1)

Objects must not have an empty title attribute

objectProvidesMechanismToReturnToParent (selector, 0)

All objects should provide a way for keyboard users to escape

Selectors: object

objectShouldHaveLongDescription (selector, 0)

An object might require a long description

Selectors: object

objectTextUpdatesWhenObjectChanges (selector, 0)

The text equivalents of an object should update if the object changes

Selectors: object

objectUIMustBeAccessible (selector, 0)

Content within an "object" element should be usable with objects disabled

Selectors: object

objectWithClassIDHasNoText (selector, 1)

Objects with "classid" attributes should change their text if the content of the object changes

Selectors: object[classid]:not(object[classid]:empty)

pNotUsedAsHeader (custom, 1)

Paragraphs must not be used for headers

See source.

WCAG techniques: G141,H42

paragraphIsWrittenClearly (custom, 0.5)

No title

See source.

WCAG techniques: G86

passwordHasLabel (label, 1)

All password input elements should have a corresponding label

WCAG techniques: H44,F68,H91

passwordLabelIsNearby (labelProximity, 0.5)

All "password" input elements have a label that is close

preShouldNotBeUsedForTabularLayout (custom, 0)

Pre elements should not be used for tabular data

See source.

WCAG techniques: F33,F34,F48

radioHasLabel (label, 1)

All "radio" input elements have a corresponding label

WCAG techniques: H44,F68,H91

radioLabelIsNearby (labelProximity, 0.5)

All "radio" input elements have a label that is close

radioMarkedWithFieldgroupAndLegend (selector, 1)

All radio button groups are marked using fieldset and legend elements

Selectors: input[type=radio]:not(fieldset input[type=radio])

WCAG techniques: H71

scriptContentAccessibleWithScriptsTurnedOff (selector, 0)

Content on the page should still be available if scripts are disabled

Selectors: script

scriptInBodyMustHaveNoscript (selector, 0.5)

Scripts should have a corresponding "noscript" element

Selectors: html:not(html:has(noscript)):has(script) body

scriptOnclickRequiresOnKeypress (event, 1)

If an element has an "onclick" attribute it should also have an "onkeypress" attribute

WCAG techniques: G90,SCR2,SCR20

scriptOndblclickRequiresOnKeypress (event, 1)

Any element with an "ondblclick" attribute should have a keyboard-related action as well

WCAG techniques: G90,SCR2,SCR20

scriptOnmousedownRequiresOnKeypress (event, 1)

If an element has a "mousedown" attribute it should also have an "onkeydown" attribute

WCAG techniques: G90,SCR2,SCR20

scriptOnmousemove (event, 1)

Any element with an "onmousemove" attribute should have a keyboard-related action as well

WCAG techniques: G90,SCR2,SCR20

scriptOnmouseoutHasOnmouseblur (event, 1)

If an element has a "onmouseout" attribute it should also have an "onblur" attribute

WCAG techniques: G90,SCR2,SCR20

scriptOnmouseoverHasOnfocus (event, 1)

If an element has a "onmouseover" attribute it should also have an "onfocus" attribute

WCAG techniques: G90,SCR2,SCR20

scriptOnmouseupHasOnkeyup (event, 1)

If an element has a "onmouseup" attribute it should also have an "onkeyup" attribute

WCAG techniques: G90,SCR2,SCR20

scriptUIMustBeAccessible (selector, 0)

The user interface for scripts should be accessible

Selectors: script

scriptsDoNotFlicker (selector, 0)

Scripts should not cause the screen to flicker

Selectors: script

WCAG techniques: F7

scriptsDoNotUseColorAlone (selector, 0)

The interface in scripts should not use color alone

Selectors: script

selectDoesNotChangeContext (event, 1)

"Select" elements must not contain an "onchange" attribute

selectHasAssociatedLabel (label, 1)

All select elements have an explicitly associated label

WCAG techniques: H44,F68,H91

selectJumpMenu (custom, 0.5)

Select jump menus should jump on button press, not on state change

See source.

WCAG techniques: F37,F9

selectWithOptionsHasOptgroup (selector, 0.5)

Form select elements should use optgroups for long selections

Selectors: select:not(select:has(optgroup)) option:nth-child(5)

WCAG techniques: H85

siteMap (custom, 0)

Websites must have a site map

See source.

WCAG techniques: G63

skipToContentLinkProvided (custom, 0.5)

A "skip to content" link should exist as one of the first links on the page

See source.

WCAG techniques: G1

svgContainsTitle (selector, 1)

Inline SVG should use Title elements

Selectors: svg:not(svg:has(title))

WCAG techniques: F65

tableAxisHasCorrespondingId (custom, 1)

Axis attribute should have corresponding IDs

See source.

WCAG techniques: F17

tabIndexFollowsLogicalOrder (custom, 0.5)

The tab order of a document is logical

See source.

WCAG techniques: H4

tableCaptionIdentifiesTable (selector, 0)

Captions should identify their table

Selectors: caption

WCAG techniques: H39

tableComplexHasSummary (selector, 0.5)

Complex tables should have a summary

Selectors: table:not(table[summary], table:has(caption))

WCAG techniques: H39

tableDataShouldHaveTh (selector, 1)

Data tables should contain "th" elements

Selectors: table:not(table:has(th))

WCAG techniques: F91

tableHeaderLabelMustBeTerse (custom, 0.5)

Table header lables must be terse

See source.

tableIsGrouped (selector, 0.5)

Mark up the areas of tables using thead and tbody

Selectors: table:not(table:has(thead), table:has(tfoot))

tableLayoutDataShouldNotHaveTh (custom, 0)

Layout tables should not contain "th" elements

See source.

WCAG techniques: F46

tableLayoutHasNoCaption (custom, 1)

All tables used for layout have no "caption" element

See source.

WCAG techniques: F46

tableLayoutHasNoSummary (custom, 0.5)

All tables used for layout have no summary or an empty summary

See source.

WCAG techniques: F46

tableLayoutMakesSenseLinearized (custom, 0)

All tables used for layout should make sense when removed

See source.

WCAG techniques: G57,F49

tableNotUsedForLayout (custom, 0.5)

Tables should not be used for layout

See source.

WCAG techniques: F49

tableShouldUseHeaderIDs (custom, 0.5)

Table cells use IDs to identify headers

See source.

WCAG techniques: H43

tableSummaryDescribesTable (selector, 0)

Table summaries should describe the navigation and structure of the table

Selectors: table[summary]

tableSummaryDoesNotDuplicateCaption (custom, 1)

Table "summary" elements should not duplicate the "caption" element

See source.

tableSummaryIsEmpty (placeholder, 0.5)

All data tables should have a summary

tableSummaryIsNotTooLong (custom, 0)

No title

See source.

tableSummaryIsSufficient (selector, 0)

All data tables should have an adequate summary

Selectors: table[summary]

tableUseColGroup (custom, 0)

Group columns using "colgroup" or "col" elements

See source.

tableUsesAbbreviationForHeader (custom, 0)

Table headers over 20 characters should provide an "abbr" attribute

See source.

tableUsesCaption (selector, 1)

Data tables should contain a "caption" element if not described elsewhere

Selectors: table:not(table:has(caption))

WCAG techniques: H39

tableUsesScopeForRow (custom, 0.5)

Data tables should use scoped headers for rows with headers

See source.

WCAG techniques: H63

tableWithBothHeadersUseScope (selector, 0.5)

Data tables with multiple headers should use the "scope" attribute

Selectors: table:has(tr:not(table tr:first) th:not(th[scope]))

WCAG techniques: F91

tableWithMoreHeadersUseID (custom, 0.5)

Complex data tables should provide "id" attributes to headers

See source.

tabularDataIsInTable (custom, 0.5)

All tabular information should use a table

See source.

WCAG techniques: F33,F34,F48

textIsNotSmall (custom, 0.5)

The text size is not less than 9 pixels high

See source.

textareaHasAssociatedLabel (label, 1)

All textareas should have a corresponding label

WCAG techniques: H44,F68,H91

textareaLabelPositionedClose (labelProximity, 0.5)

All textareas should have a label that is close to it

videoProvidesCaptions (selector, 0.5)

All video tags must provide captions

Selectors: video

WCAG techniques: G87

videosEmbeddedOrLinkedNeedCaptions (custom, 1)

All linked or embedded videos need captions

See source.

WCAG techniques: G87

whiteSpaceInWord (custom, 0.5)

Whitespace should not be used between characters in a word

See source.

WCAG techniques: F32,C8

whiteSpaceNotUsedForFormatting (custom, 0.5)

Whitespace should not be used for conveying information

See source.

WCAG techniques: G57

doNotUseGraphicalSymbolToConveyInformation (custom, 1)

Using a graphical symbol alone to convey information

See source.

WCAG techniques: F26

linkDoesNotChangeContextOnFocus (event, 1)

Link elements must not contain an "onfocus" attribute

buttonDoesNotChangeContextOnFocus (event, 1)

Buttons must not contain an "onfocus" attribute

KINGStrongList (custom, 1)

Use strong in lists only

See source.

KINGUseLongDateFormat (custom, 1)

Use a long date format

See source.

KINGUsePercentageWithSymbol (custom, 1)

Use a symbol within a percentage

See source.

KINGUseCurrencyAsSymbol (custom, 1)

Use a symbol for a currency

See source.

/**
* Code used to generate markdown file.
*
* This test assumes that you have global variable `tests` where you hold parsed `tests.json` file.
*/
// A helper function to format WCAG guideline links.
function buildWcagGuideline( testObj ) {
var guidelines = testObj.guidelines.wcag;
var keys = Object.keys( guidelines );
var ret = [];
if ( !keys.length ) {
return '';
}
keys.forEach( function( key ) {
guidelines[ key ].techniques.forEach( function( technique ) {
if ( ret.indexOf( technique ) === -1 ) {
ret.push( technique );
}
} );
} );
return ret.map( function( technique ) {
return '[`' + technique + '`](http://www.w3.org/TR/WCAG20-TECHS/' + technique + '.html)';
} );
}
function formattingFunction( testIndex ) {
var testObj = tests[ testIndex ],
lines = [
'### ' + testIndex + ' (' + testObj.type + ', ' + testObj.testability + ')',
testObj.title ? testObj.title.en : '_No title_'
];
// Adding an info depending on test type, be it link to JS code or CSS selector.
if ( testObj.type == 'custom' ) {
lines.push( 'See [source](https://github.com/quailjs/quail/blob/dev/src/js/custom/' + testIndex + '.js).' );
} else if ( testObj.type == 'selector' ) {
lines.push( 'Selectors: ' +
( testObj.options ? '`' + testObj.options.selector + '`' : '_none_' )
);
}
// If WCAG techniques are specified, lets give link to it.
if ( testObj.guidelines && testObj.guidelines.wcag ) {
var techniques = buildWcagGuideline( testObj );
if ( techniques ) {
lines.push( 'WCAG techniques: ' + techniques.join( ',' ) );
}
}
lines.push( '* ' );
return lines.join( '\n\n' );
}
// Generate lines.
var out = Object.keys( tests ).map( formattingFunction );
// Copy it to clipboard.
copy( out.join( '\n\n' ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment