Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axe runner doesn't include wcag2aaa tag when standard is set to WCAG2AAA. #666

Open
osimblahan opened this issue Jan 10, 2023 · 2 comments

Comments

@osimblahan
Copy link

Expected behaviour

Axe WCAG2AAA tagged tests should be included.

Actual behaviour

They are not. (Only three tests exist at this time.)

Tag is listed in the axe docs. (There is also the wcag22aa tag with one test, but that's not technically a standard yet.)
https://www.deque.com/axe/core-documentation/api-documentation/#api-notes

Steps to reproduce

Run pa11y with standard: 'WCAG2AAA' and the axe runner.

Problem area in runners/axe.js

function pa11yStandardToAxe() {
    switch (options.standard) {
        case 'WCAG2A':
            return {
                type: 'tags',
                values: ['wcag2a', 'wcag21a', 'best-practice']
            };
        case 'WCAG2AA':
        case 'WCAG2AAA':
        default:
            return {
                type: 'tags',
                values: ['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'best-practice']
            };
    }
}
@camtin
Copy link

camtin commented Oct 27, 2023

Since WCAG 2.2 is now the standard, I wonder if we should include WCAG 2.2.

Additionally, I wonder if we should "accept" options that are more like:

WCAG2A
WCAG21A
WCAG22A
WCAG2AA
WCAG21AA
WCAG22AA
WCAG2AAA
WCAG21AAA
WCAG22AAA

Or is there a specific reason Pa11y doesn't differentiate between the different revisions here?

@camtin
Copy link

camtin commented Oct 27, 2023

Essentially, I think we want this (based on the available options from Axe core)
https://www.deque.com/axe/core-documentation/api-documentation/

This always includes best practices, and makes WCAG 2.2 AAA.

Unfortunately I think this is a breaking change though as WCAG2A now would map to WCAG 2.0 A for example, not WCAG 2.1 A anymore.

	/**
	 * Map the Pa11y standard option to the aXe runOnly option.
	 * @private
	 * @returns {RunOnly} Returns the aXe runOnly value.
	 */
	function pa11yStandardToAxe() {
		console.log("Scan Standard: "+options.standard);
		switch (options.standard) {
			case 'WCAG2A':
				return {
					type: 'tags',
					values: ['wcag2a','best-practice']
				};

			case 'WCAG2AA':
				return {
					type: 'tags',
					values: ['wcag2a', 'wcag2aa', 'best-practice']
				};	

			case 'WCAG2AAA':
				return {
					type: 'tags',
					values: ['wcag2a', 'wcag2aa', 'wcag2aaa', 'best-practice']
				};				

			case 'WCAG21A':
			case 'WCAG22A':				
				return {
					type: 'tags',
					values: ['wcag2a', 'wcag21a', 'best-practice']
				};	

			case 'WCAG21AA':
				return {
					type: 'tags',
					values: ['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'best-practice']
				};	

			case 'WCAG21AA':
				return {
					type: 'tags',
					values: ['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'wcag2aaa', 'best-practice']
				};

			case 'WCAG22AA':
				return {
					type: 'tags',
					values: ['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'wcag22aa', 'best-practice']
				};	

			case 'WCAG22AAA':
				return {
					type: 'tags',
					values: ['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'wcag22aa', 'wcag2aaa', 'best-practice']
				};	

			default:
				return {
					type: 'tags',
					values: ['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'wcag22aa', 'best-practice']
				};
		}
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants