From c1e9d587f6c4d8ac00d8051674a1322574ec91ce Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Tue, 15 Jan 2019 12:58:58 -0800 Subject: [PATCH 1/5] deps: update axe-core to latest --- .appveyor.yml | 2 +- .../test/fixtures/a11y/a11y_tester.html | 7 +-- .../test/smokehouse/a11y/expectations.js | 16 +++--- lighthouse-cli/test/smokehouse/run-smoke.js | 2 +- .../accessibility/{ => manual}/accesskeys.js | 22 +++++---- lighthouse-core/config/default-config.js | 4 +- lighthouse-core/lib/i18n/en-US.json | 20 +++----- .../audits/accessibility/accesskeys-test.js | 43 ---------------- .../test/results/artifacts/artifacts.json | 13 ----- lighthouse-core/test/results/sample_v2.json | 49 +++++++++---------- package.json | 2 +- proto/sample_v2_round_trip.json | 23 +++++---- yarn.lock | 8 +-- 13 files changed, 72 insertions(+), 139 deletions(-) rename lighthouse-core/audits/accessibility/{ => manual}/accesskeys.js (72%) delete mode 100644 lighthouse-core/test/audits/accessibility/accesskeys-test.js diff --git a/.appveyor.yml b/.appveyor.yml index 69de01ad5d79..71902d735df3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -42,7 +42,7 @@ test_script: # FIXME: Exclude Appveyor from running `perf` smoketest until we fix the flake. # https://github.com/GoogleChrome/lighthouse/issues/5053 # - yarn smoke - - yarn smoke ally pwa pwa2 pwa3 dbw redirects seo offline byte metrics + - yarn smoke a11y pwa pwa2 pwa3 dbw redirects seo offline byte metrics cache: #- chrome-win32 -> appveyor.yml,package.json diff --git a/lighthouse-cli/test/fixtures/a11y/a11y_tester.html b/lighthouse-cli/test/fixtures/a11y/a11y_tester.html index afa2429441cb..a3e338a80a0e 100644 --- a/lighthouse-cli/test/fixtures/a11y/a11y_tester.html +++ b/lighthouse-cli/test/fixtures/a11y/a11y_tester.html @@ -11,11 +11,6 @@ -

accesskeys

-
-
accesskey h
-
accesskey h
-

aria-allowed-attr

layout-table

- +
diff --git a/lighthouse-cli/test/smokehouse/a11y/expectations.js b/lighthouse-cli/test/smokehouse/a11y/expectations.js index 77518a99c0e3..256d91c9272d 100644 --- a/lighthouse-cli/test/smokehouse/a11y/expectations.js +++ b/lighthouse-cli/test/smokehouse/a11y/expectations.js @@ -13,14 +13,6 @@ module.exports = [ requestedUrl: 'http://localhost:10200/a11y/a11y_tester.html', finalUrl: 'http://localhost:10200/a11y/a11y_tester.html', audits: { - 'accesskeys': { - score: 0, - details: { - items: { - length: 1, - }, - }, - }, 'aria-allowed-attr': { score: 0, details: { @@ -166,10 +158,10 @@ module.exports = [ }, }, 'layout-table': { - score: 0, + score: 1, details: { items: { - length: 1, + length: 0, }, }, }, @@ -237,6 +229,10 @@ module.exports = [ }, }, }, + 'accesskeys': { + score: null, + scoreDisplayMode: 'manual', + }, }, }, ]; diff --git a/lighthouse-cli/test/smokehouse/run-smoke.js b/lighthouse-cli/test/smokehouse/run-smoke.js index a456d8410302..bea6c5f9f170 100644 --- a/lighthouse-cli/test/smokehouse/run-smoke.js +++ b/lighthouse-cli/test/smokehouse/run-smoke.js @@ -26,7 +26,7 @@ const smokehouseDir = 'lighthouse-cli/test/smokehouse/'; /** @type {Array} */ const SMOKETESTS = [{ - id: 'ally', + id: 'a11y', config: smokehouseDir + 'a11y/a11y-config.js', expectations: 'a11y/expectations.js', batch: 'parallel-first', diff --git a/lighthouse-core/audits/accessibility/accesskeys.js b/lighthouse-core/audits/accessibility/manual/accesskeys.js similarity index 72% rename from lighthouse-core/audits/accessibility/accesskeys.js rename to lighthouse-core/audits/accessibility/manual/accesskeys.js index 28c7cff97237..1e98191e953a 100644 --- a/lighthouse-core/audits/accessibility/accesskeys.js +++ b/lighthouse-core/audits/accessibility/manual/accesskeys.js @@ -6,18 +6,15 @@ 'use strict'; /** - * @fileoverview Ensures every accesskey attribute value is unique. - * See base class in axe-audit.js for audit() implementation. + * @fileoverview Manual a11y audit to remind to check every accesskey attribute value is unique. */ -const AxeAudit = require('./axe-audit'); -const i18n = require('../../lib/i18n/i18n.js'); +const Audit = require('../../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 accesskey HTML attribute values are unique across all elements. 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. ' + @@ -26,7 +23,7 @@ const UIStrings = { const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); -class Accesskeys extends AxeAudit { +class Accesskeys extends Audit { /** * @return {LH.Audit.Meta} */ @@ -34,11 +31,18 @@ class Accesskeys extends AxeAudit { return { id: 'accesskeys', title: str_(UIStrings.title), - failureTitle: str_(UIStrings.failureTitle), description: str_(UIStrings.description), - requiredArtifacts: ['Accessibility'], + scoreDisplayMode: Audit.SCORING_MODES.MANUAL, + requiredArtifacts: [], }; } + + /** + * @return {LH.Audit.Product} + */ + static audit() { + return {rawValue: false}; + } } module.exports = Accesskeys; diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 59821c6e370c..75df84c4609d 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -169,7 +169,6 @@ const defaultConfig = { 'manual/pwa-cross-browser', 'manual/pwa-page-transitions', 'manual/pwa-each-page-has-url', - 'accessibility/accesskeys', 'accessibility/aria-allowed-attr', 'accessibility/aria-required-attr', 'accessibility/aria-required-children', @@ -204,6 +203,7 @@ const defaultConfig = { 'accessibility/valid-lang', 'accessibility/video-caption', 'accessibility/video-description', + 'accessibility/manual/accesskeys', 'accessibility/manual/custom-controls-labels', 'accessibility/manual/custom-controls-roles', 'accessibility/manual/focus-traps', @@ -363,7 +363,6 @@ const defaultConfig = { description: 'These checks highlight opportunities to [improve the accessibility of your web app](https://developers.google.com/web/fundamentals/accessibility). Only a subset of accessibility issues can be automatically detected so manual testing is also encouraged.', manualDescription: 'These items address areas which an automated testing tool cannot cover. Learn more in our guide on [conducting an accessibility review](https://developers.google.com/web/fundamentals/accessibility/how-to-review).', auditRefs: [ - {id: 'accesskeys', weight: 1, group: 'a11y-correct-attributes'}, {id: 'aria-allowed-attr', weight: 3, group: 'a11y-aria'}, {id: 'aria-required-attr', weight: 2, group: 'a11y-aria'}, {id: 'aria-required-children', weight: 5, group: 'a11y-aria'}, @@ -399,6 +398,7 @@ const defaultConfig = { {id: 'video-caption', weight: 4, group: 'a11y-describe-contents'}, {id: 'video-description', weight: 3, group: 'a11y-describe-contents'}, // Manual audits + {id: 'accesskeys', weight: 0}, {id: 'logical-tab-order', weight: 0}, {id: 'focusable-controls', weight: 0}, {id: 'interactive-element-affordance', weight: 0}, diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 084d1deef6f3..82230296325a 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -1,16 +1,4 @@ { - "lighthouse-core/audits/accessibility/accesskeys.js | description": { - "message": "Access keys let users quickly focus a part of the page. For proper navigation, each access key must be unique. [Learn more](https://dequeuniversity.com/rules/axe/2.2/accesskeys?application=lighthouse).", - "description": "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." - }, - "lighthouse-core/audits/accessibility/accesskeys.js | failureTitle": { - "message": "`[accesskey]` values are not unique", - "description": "Title of an accesibility audit that evaluates if the accesskey HTML attribute values are unique across all elements. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed." - }, - "lighthouse-core/audits/accessibility/accesskeys.js | title": { - "message": "`[accesskey]` values are unique", - "description": "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." - }, "lighthouse-core/audits/accessibility/aria-allowed-attr.js | description": { "message": "Each ARIA `role` supports a specific subset of `aria-*` attributes. Mismatching these invalidates the `aria-*` attributes. [Learn more](https://dequeuniversity.com/rules/axe/2.2/aria-allowed-attr?application=lighthouse).", "description": "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." @@ -315,6 +303,14 @@ "message": "List items (`
  • `) are contained within `