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

report: reorganize a11y audit groups #7129

Merged
merged 9 commits into from
Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
145 changes: 73 additions & 72 deletions lighthouse-cli/test/cli/__snapshots__/index-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ Object {
Object {
"path": "manual/pwa-each-page-has-url",
},
Object {
"path": "accessibility/accesskeys",
},
Object {
"path": "accessibility/aria-allowed-attr",
},
Expand Down Expand Up @@ -231,9 +234,6 @@ Object {
Object {
"path": "accessibility/video-description",
},
Object {
"path": "accessibility/manual/accesskeys",
},
Object {
"path": "accessibility/manual/custom-controls-labels",
},
Expand Down Expand Up @@ -376,6 +376,11 @@ Object {
"categories": Object {
"accessibility": Object {
"auditRefs": Array [
Object {
"group": "a11y-navigation",
"id": "accesskeys",
"weight": 3,
},
Object {
"group": "a11y-aria",
"id": "aria-allowed-attr",
Expand Down Expand Up @@ -412,17 +417,17 @@ Object {
"weight": 5,
},
Object {
"group": "a11y-correct-attributes",
"group": "a11y-audio-video",
"id": "audio-caption",
"weight": 4,
},
Object {
"group": "a11y-element-names",
"group": "a11y-names-labels",
"id": "button-name",
"weight": 10,
},
Object {
"group": "a11y-describe-contents",
"group": "a11y-navigation",
"id": "bypass",
"weight": 10,
},
Expand All @@ -432,27 +437,27 @@ Object {
"weight": 6,
},
Object {
"group": "a11y-well-structured",
"group": "a11y-tables-lists",
"id": "definition-list",
"weight": 1,
},
Object {
"group": "a11y-well-structured",
"group": "a11y-tables-lists",
"id": "dlitem",
"weight": 1,
},
Object {
"group": "a11y-describe-contents",
"group": "a11y-names-labels",
"id": "document-title",
"weight": 2,
},
Object {
"group": "a11y-well-structured",
"group": "a11y-best-practices",
"id": "duplicate-id",
"weight": 5,
},
Object {
"group": "a11y-describe-contents",
"group": "a11y-names-labels",
"id": "frame-title",
"weight": 5,
},
Expand All @@ -467,67 +472,67 @@ Object {
"weight": 1,
},
Object {
"group": "a11y-correct-attributes",
"group": "a11y-names-labels",
"id": "image-alt",
"weight": 8,
},
Object {
"group": "a11y-correct-attributes",
"group": "a11y-names-labels",
"id": "input-image-alt",
"weight": 1,
},
Object {
"group": "a11y-describe-contents",
"group": "a11y-names-labels",
"id": "label",
"weight": 10,
},
Object {
"group": "a11y-describe-contents",
"group": "a11y-tables-lists",
"id": "layout-table",
"weight": 1,
},
Object {
"group": "a11y-element-names",
"group": "a11y-names-labels",
"id": "link-name",
"weight": 9,
},
Object {
"group": "a11y-well-structured",
"group": "a11y-tables-lists",
"id": "list",
"weight": 5,
},
Object {
"group": "a11y-well-structured",
"group": "a11y-tables-lists",
"id": "listitem",
"weight": 4,
},
Object {
"group": "a11y-meta",
"group": "a11y-best-practices",
"id": "meta-refresh",
"weight": 1,
},
Object {
"group": "a11y-meta",
"group": "a11y-best-practices",
"id": "meta-viewport",
"weight": 3,
},
Object {
"group": "a11y-describe-contents",
"group": "a11y-names-labels",
"id": "object-alt",
"weight": 4,
},
Object {
"group": "a11y-correct-attributes",
"group": "a11y-navigation",
"id": "tabindex",
"weight": 4,
},
Object {
"group": "a11y-correct-attributes",
"group": "a11y-tables-lists",
"id": "td-headers-attr",
"weight": 1,
},
Object {
"group": "a11y-correct-attributes",
"group": "a11y-tables-lists",
"id": "th-has-data-cells",
"weight": 1,
},
Expand All @@ -537,19 +542,15 @@ Object {
"weight": 1,
},
Object {
"group": "a11y-describe-contents",
"group": "a11y-audio-video",
"id": "video-caption",
"weight": 4,
},
Object {
"group": "a11y-describe-contents",
"group": "a11y-audio-video",
"id": "video-description",
"weight": 3,
},
Object {
"id": "accesskeys",
"weight": 0,
},
Object {
"id": "logical-tab-order",
"weight": 0,
Expand Down Expand Up @@ -999,35 +1000,35 @@ Object {
"groups": Object {
"a11y-aria": Object {
"description": "These are opportunities to improve the usage of ARIA in your application which may enhance the experience for users of assistive technology, like a screen reader.",
"title": "ARIA Attributes Follow Best Practices",
},
"a11y-color-contrast": Object {
"description": "These are opportunities to improve the legibility of your content.",
"title": "Color Contrast Is Satisfactory",
"title": "ARIA",
},
"a11y-correct-attributes": Object {
"description": "These are opportunities to improve the configuration of your HTML elements.",
"title": "Elements Use Attributes Correctly",
"a11y-audio-video": Object {
"description": "These are opportunities to provide alternative content for audio and video. This may improve the experience for users with hearing or vision impairments.",
"title": "Audio and video",
},
"a11y-describe-contents": Object {
"description": "These are opportunities to make your content easier to understand for a user of assistive technology, like a screen reader.",
"title": "Elements Describe Contents Well",
"a11y-best-practices": Object {
"description": "These items highlight common accessibility best practices.",
"title": "Best practices",
},
"a11y-element-names": Object {
"description": "These are opportunities to improve the semantics of the controls in your application. This may enhance the experience for users of assistive technology, like a screen reader.",
"title": "Elements Have Discernible Names",
"a11y-color-contrast": Object {
"description": "These are opportunities to improve the legibility of your content.",
"title": "Contrast",
},
"a11y-language": Object {
"description": "These are opportunities to improve the interpretation of your content by users in different locales.",
"title": "Page Specifies Valid Language",
"title": "Internationalization and localization",
},
"a11y-meta": Object {
"description": "These are opportunities to improve the user experience of your site.",
"title": "Meta Tags Used Properly",
"a11y-names-labels": Object {
"description": "These are opportunities to improve the semantics of the controls in your application. This may enhance the experience for users of assistive technology, like a screen reader.",
"title": "Names and labels",
},
"a11y-navigation": Object {
"description": "These are opportunities to improve keyboard navigation in your application.",
"title": "Navigation",
},
"a11y-well-structured": Object {
"description": "These are opportunities to make sure your HTML is appropriately structured.",
"title": "Elements Are Well Structured",
"a11y-tables-lists": Object {
"description": "These are opportunities to to improve the experience of reading tabular or list data using assistive technology, like a screen reader.",
"title": "Tables and lists",
},
"diagnostics": Object {
"description": "More information about the performance of your application.",
Expand Down Expand Up @@ -1248,35 +1249,35 @@ Object {
"groups": Object {
"a11y-aria": Object {
"description": "These are opportunities to improve the usage of ARIA in your application which may enhance the experience for users of assistive technology, like a screen reader.",
"title": "ARIA Attributes Follow Best Practices",
},
"a11y-color-contrast": Object {
"description": "These are opportunities to improve the legibility of your content.",
"title": "Color Contrast Is Satisfactory",
"title": "ARIA",
},
"a11y-correct-attributes": Object {
"description": "These are opportunities to improve the configuration of your HTML elements.",
"title": "Elements Use Attributes Correctly",
"a11y-audio-video": Object {
"description": "These are opportunities to provide alternative content for audio and video. This may improve the experience for users with hearing or vision impairments.",
"title": "Audio and video",
},
"a11y-describe-contents": Object {
"description": "These are opportunities to make your content easier to understand for a user of assistive technology, like a screen reader.",
"title": "Elements Describe Contents Well",
"a11y-best-practices": Object {
"description": "These items highlight common accessibility best practices.",
"title": "Best practices",
},
"a11y-element-names": Object {
"description": "These are opportunities to improve the semantics of the controls in your application. This may enhance the experience for users of assistive technology, like a screen reader.",
"title": "Elements Have Discernible Names",
"a11y-color-contrast": Object {
"description": "These are opportunities to improve the legibility of your content.",
"title": "Contrast",
},
"a11y-language": Object {
"description": "These are opportunities to improve the interpretation of your content by users in different locales.",
"title": "Page Specifies Valid Language",
"title": "Internationalization and localization",
},
"a11y-names-labels": Object {
"description": "These are opportunities to improve the semantics of the controls in your application. This may enhance the experience for users of assistive technology, like a screen reader.",
"title": "Names and labels",
},
"a11y-meta": Object {
"description": "These are opportunities to improve the user experience of your site.",
"title": "Meta Tags Used Properly",
"a11y-navigation": Object {
"description": "These are opportunities to improve keyboard navigation in your application.",
"title": "Navigation",
},
"a11y-well-structured": Object {
"description": "These are opportunities to make sure your HTML is appropriately structured.",
"title": "Elements Are Well Structured",
"a11y-tables-lists": Object {
"description": "These are opportunities to to improve the experience of reading tabular or list data using assistive technology, like a screen reader.",
"title": "Tables and lists",
},
"diagnostics": Object {
"description": "More information about the performance of your application.",
Expand Down
5 changes: 5 additions & 0 deletions lighthouse-cli/test/fixtures/a11y/a11y_tester.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
<meta name="viewport" content="user-scalable=no, maximum-scale=1.0">
</head>
<body>
<p>accesskeys</p>
<section>
<button id="accesskeys1" accesskey="s">Foo</button>
<button id="accesskeys2" accesskey="s">Bar</button>
</section>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 thanks for adding this!

<p>aria-allowed-attr</p>
<section>
<div
Expand Down
8 changes: 6 additions & 2 deletions lighthouse-cli/test/smokehouse/a11y/expectations.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,12 @@ module.exports = [
},
},
'accesskeys': {
score: null,
scoreDisplayMode: 'manual',
score: 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to fix the CI error, it looks like this might be

score: null,
scoreDisplayMode: 'notApplicable',

?

But did something change with the audit since removal in #7020?

details: {
items: {
length: 1,
},
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
'use strict';

/**
* @fileoverview Manual a11y audit to remind to check every accesskey attribute value is unique.
* @fileoverview Ensures accesskey values are unique.
* See base class in axe-audit.js for audit() implementation.
*/

const Audit = require('../../audit.js');
const i18n = require('../../../lib/i18n/i18n.js');
const AxeAudit = require('./axe-audit.js');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Title of an accesibility audit that evaluates if the accesskey HTML attribute values are unique across all elements. This title is descriptive of the successful state and is shown to users when no user action is required. */
title: '`[accesskey]` values are unique',
/** Title of an accesibility audit that evaluates if the ARIA HTML attributes are misaligned with the aria-role HTML attribute specificed on the element, such mismatches are invalid. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
failureTitle: '`[accesskey]` values are not unique',
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
description: 'Access keys let users quickly focus a part of the page. For proper ' +
'navigation, each access key must be unique. ' +
Expand All @@ -23,26 +26,19 @@ const UIStrings = {

const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);

class Accesskeys extends Audit {
class Accesskeys extends AxeAudit {
/**
* @return {LH.Audit.Meta}
*/
static get meta() {
return {
id: 'accesskeys',
title: str_(UIStrings.title),
failureTitle: str_(UIStrings.failureTitle),
description: str_(UIStrings.description),
scoreDisplayMode: Audit.SCORING_MODES.MANUAL,
requiredArtifacts: [],
requiredArtifacts: ['Accessibility'],
};
}

/**
* @return {LH.Audit.Product}
*/
static audit() {
return {rawValue: false};
}
}

module.exports = Accesskeys;
Expand Down