SC3-2-3-navigational-links-across-pages

From Automated WCAG Monitoring Community Group
Jump to: navigation, search

This test belongs to 3.2.3 Consistent Navigation.

Status

Version 0.1: For review

Version 0: For review

Description

This test checks if the order of navigational components and repeated links within a set of Web pages remains consistent.

Background

Assumptions

  • This test assumes that the order of navigational elements on the page was not changed by the user.
  • This test assumes that comparing a page to the pages that are linked from it is sufficient to judge the applicability of the success criterion.
  • If one page has a different menu structure, all pages that are linked from it would get a failed result which might exaggerate the overall results and this is intentional.
  • This test checks only navigational components that are matched by the selector. Other navigational components like search boxes are not checked.

Test properties

Property Possible values
Success Criterion 3.2.3 Consistent Navigation
Test name Presentation of navigational components
Test mode Automatic
Test environment HTML source or DOM
Test subject Multiple web pages
User expertise and skills
User profile

Test procedure

Selector

Test mode: earl:automatic

Select the following elements:

  • elements with role="navigation"
  • <nav> elements
  • <ul> and <ol> elements that contain <li> elements with internal links and the list does not contain any other text, images or user input elements outside of links. Sometimes the active menu item (current page) is a text and not a link. If the list contains one item that is not a link, this list should still be selected.
  • Lists nested within other lists are considered a single list. From them the outermost list element or nav element is selected.

N1 = list of all selected elements.

Step 1

Test mode: earl:automatic

If there are internal links on the current page (P1)

Make list of all internal links and continue with #Step 2

else return

Property Value
TestCase SC3-2-3-Navigational-links-across-pages
Identifier SC3-2-3-Navigational-links-across-pages-inapplicable1
Outcome inapplicable
Pointer position
Info


Step 2

Test mode: earl:automatic

Download all the pages determined by the list constructed in #Step 1 (P2 .. Pn). Apply the #Selector of this test case to the pages, selecting lists N2 ... Nn for P2 ... Pn.

If all lists N2 ... Nn are empty, return

Property Value
TestCase SC3-2-3-Navigational-links-across-pages
Identifier SC3-2-3-Navigational-links-across-pages-inapplicable2
Outcome inapplicable
Pointer position
Info


Else continue with #Step 3.

Step 3

Test mode: earl:automatic

The elements on list Nj are identified by the element type and the id of the element or the id of the first ancestor with an id. If there is no ancestor with id, the id is left empty.

Compare N1 to N2 ... Nn. (Both the element type and the id are compared.)

If N1 does not have the same relative order as N2 ... Nn, return

Property Value
TestCase SC3-2-3-Navigational-links-across-pages
Identifier SC3-2-3-Navigational-links-across-pages-fail1
Outcome failed
ErrorMessage Navigational components of pages are not in the same relative order.
Pointer position
Info


else continue with #Step 4

Step 4

Test mode: earl:automatic


Lj = list of link texts of all the navigational links in Nj.

Note that Lj is a flat list that contains all navigational links from page Pj in DOM order. Only the link text, i.e. link.textContent is extracted.

Compare L1 to L2 ... Ln.

If L1 does not have the same relative order as L2 ... Ln, return

Property Value
TestCase SC3-2-3-Navigational-links-across-pages
Identifier SC3-2-3-Navigational-links-across-pages-fail2
Outcome failed
ErrorMessage Navigational links of pages are not in the same relative order.
Pointer position
Info


else, return

Property Value
TestCase SC3-2-3-Navigational-links-across-pages
Identifier SC3-2-3-Navigational-links-across-pages-pass1
Outcome passed
Pointer position
Info