From b0df777b09048ab8bca9d2a9a0b453b376984b67 Mon Sep 17 00:00:00 2001 From: Even Stensberg Date: Sat, 8 Jul 2017 01:40:58 +0200 Subject: [PATCH] Add failureDescription to audit. display on fail (#2478) --- lighthouse-core/audits/accessibility/accesskeys.js | 1 + .../audits/accessibility/aria-allowed-attr.js | 1 + .../audits/accessibility/aria-required-attr.js | 1 + .../audits/accessibility/aria-required-children.js | 4 +++- .../audits/accessibility/aria-required-parent.js | 1 + lighthouse-core/audits/accessibility/aria-roles.js | 1 + .../audits/accessibility/aria-valid-attr-value.js | 1 + lighthouse-core/audits/accessibility/aria-valid-attr.js | 1 + lighthouse-core/audits/accessibility/audio-caption.js | 2 ++ lighthouse-core/audits/accessibility/button-name.js | 1 + lighthouse-core/audits/accessibility/bypass.js | 1 + lighthouse-core/audits/accessibility/color-contrast.js | 2 ++ lighthouse-core/audits/accessibility/definition-list.js | 4 +++- lighthouse-core/audits/accessibility/dlitem.js | 1 + lighthouse-core/audits/accessibility/document-title.js | 1 + lighthouse-core/audits/accessibility/duplicate-id.js | 1 + lighthouse-core/audits/accessibility/frame-title.js | 1 + lighthouse-core/audits/accessibility/html-has-lang.js | 1 + lighthouse-core/audits/accessibility/html-lang-valid.js | 2 ++ lighthouse-core/audits/accessibility/image-alt.js | 1 + lighthouse-core/audits/accessibility/input-image-alt.js | 1 + lighthouse-core/audits/accessibility/label.js | 1 + lighthouse-core/audits/accessibility/layout-table.js | 2 ++ lighthouse-core/audits/accessibility/link-name.js | 1 + lighthouse-core/audits/accessibility/list.js | 2 ++ lighthouse-core/audits/accessibility/listitem.js | 2 ++ lighthouse-core/audits/accessibility/meta-refresh.js | 1 + lighthouse-core/audits/accessibility/meta-viewport.js | 2 ++ lighthouse-core/audits/accessibility/object-alt.js | 1 + lighthouse-core/audits/accessibility/tabindex.js | 1 + lighthouse-core/audits/accessibility/td-headers-attr.js | 2 ++ .../audits/accessibility/th-has-data-cells.js | 2 ++ lighthouse-core/audits/accessibility/valid-lang.js | 1 + lighthouse-core/audits/accessibility/video-caption.js | 2 ++ .../audits/accessibility/video-description.js | 2 ++ lighthouse-core/audits/audit.js | 9 +++++++-- .../audits/byte-efficiency/total-byte-weight.js | 1 + lighthouse-core/audits/cache-start-url.js | 1 + lighthouse-core/audits/content-width.js | 1 + lighthouse-core/audits/deprecations.js | 1 + lighthouse-core/audits/dobetterweb/appcache-manifest.js | 1 + lighthouse-core/audits/dobetterweb/dom-size.js | 3 ++- .../dobetterweb/external-anchors-use-rel-noopener.js | 1 + .../audits/dobetterweb/geolocation-on-start.js | 1 + lighthouse-core/audits/dobetterweb/no-document-write.js | 1 + lighthouse-core/audits/dobetterweb/no-mutation-events.js | 1 + lighthouse-core/audits/dobetterweb/no-old-flexbox.js | 1 + lighthouse-core/audits/dobetterweb/no-websql.js | 1 + .../audits/dobetterweb/notification-on-start.js | 1 + .../dobetterweb/password-inputs-can-be-pasted-into.js | 3 ++- lighthouse-core/audits/dobetterweb/uses-http2.js | 1 + .../audits/dobetterweb/uses-passive-event-listeners.js | 1 + lighthouse-core/audits/is-on-https.js | 1 + lighthouse-core/audits/load-fast-enough-for-pwa.js | 1 + lighthouse-core/audits/manifest-short-name-length.js | 2 ++ lighthouse-core/audits/redirects-http.js | 1 + lighthouse-core/audits/service-worker.js | 1 + lighthouse-core/audits/splash-screen.js | 5 ++--- lighthouse-core/audits/themed-omnibox.js | 3 ++- lighthouse-core/audits/viewport.js | 2 ++ lighthouse-core/audits/webapp-install-banner.js | 1 + lighthouse-core/audits/without-javascript.js | 1 + lighthouse-core/audits/works-offline.js | 1 + lighthouse-core/config/config.js | 7 +++++++ 64 files changed, 97 insertions(+), 10 deletions(-) diff --git a/lighthouse-core/audits/accessibility/accesskeys.js b/lighthouse-core/audits/accessibility/accesskeys.js index f2eb578fa7af..b843bf4506f1 100644 --- a/lighthouse-core/audits/accessibility/accesskeys.js +++ b/lighthouse-core/audits/accessibility/accesskeys.js @@ -21,6 +21,7 @@ class Accesskeys extends AxeAudit { category: 'Accessibility', name: 'accesskeys', description: '`[accesskey]` values are unique.', + failureDescription: '`[accesskey]` values are not unique.', helpText: '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/1.1/accesskeys).', diff --git a/lighthouse-core/audits/accessibility/aria-allowed-attr.js b/lighthouse-core/audits/accessibility/aria-allowed-attr.js index 238daf5a681f..4a1f7e1452ad 100644 --- a/lighthouse-core/audits/accessibility/aria-allowed-attr.js +++ b/lighthouse-core/audits/accessibility/aria-allowed-attr.js @@ -21,6 +21,7 @@ class ARIAAllowedAttr extends AxeAudit { category: 'Accessibility', name: 'aria-allowed-attr', description: '`[aria-*]` attributes match their roles.', + failureDescription: '`[aria-*]` attributes do not match their roles.', helpText: 'Each ARIA `role` supports a specific subset of `aria-*` attributes. ' + 'Mismatching these invalidates the `aria-*` attributes. [Learn ' + 'more](https://developers.google.com/web/tools/lighthouse/audits/aria-allowed-attributes).', diff --git a/lighthouse-core/audits/accessibility/aria-required-attr.js b/lighthouse-core/audits/accessibility/aria-required-attr.js index 280e062d1433..8bd463a993d3 100644 --- a/lighthouse-core/audits/accessibility/aria-required-attr.js +++ b/lighthouse-core/audits/accessibility/aria-required-attr.js @@ -21,6 +21,7 @@ class ARIARequiredAttr extends AxeAudit { category: 'Accessibility', name: 'aria-required-attr', description: '`[role]`s have all required `[aria-*]` attributes.', + failureDescription: '`[role]`s do not have all required `[aria-*]` attributes.', helpText: 'Some ARIA roles have required attributes that describe the state ' + 'of the element to screen readers. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/required-aria-attributes).', requiredArtifacts: ['Accessibility'] diff --git a/lighthouse-core/audits/accessibility/aria-required-children.js b/lighthouse-core/audits/accessibility/aria-required-children.js index 2b331aba1856..0de501aaaaac 100644 --- a/lighthouse-core/audits/accessibility/aria-required-children.js +++ b/lighthouse-core/audits/accessibility/aria-required-children.js @@ -21,7 +21,9 @@ class AriaRequiredChildren extends AxeAudit { return { category: 'Accessibility', name: 'aria-required-children', - description: '`[role]`s that require child `[role]`s contain them.', + description: 'Elements with `[role]` that require specific children `[role]`s, are present.', + failureDescription: 'Elements with `[role]` that require specific children `[role]`s, ' + + 'are missing.', helpText: 'Some ARIA parent roles must contain specific child roles to perform ' + 'their intended accessibility functions. ' + '[Learn more](https://dequeuniversity.com/rules/axe/1.1/aria-required-children).', diff --git a/lighthouse-core/audits/accessibility/aria-required-parent.js b/lighthouse-core/audits/accessibility/aria-required-parent.js index acc0289d6ea0..2b1a8f6ccd90 100644 --- a/lighthouse-core/audits/accessibility/aria-required-parent.js +++ b/lighthouse-core/audits/accessibility/aria-required-parent.js @@ -22,6 +22,7 @@ class AriaRequiredParent extends AxeAudit { category: 'Accessibility', name: 'aria-required-parent', description: '`[role]`s are contained by their required parent element.', + failureDescription: '`[role]`s are not contained by their required parent element.', helpText: 'Some ARIA child roles must be contained by specific parent roles to ' + 'properly perform their intended accessibility functions. ' + '[Learn more](https://dequeuniversity.com/rules/worldspace/2.1/aria-required-parent).', diff --git a/lighthouse-core/audits/accessibility/aria-roles.js b/lighthouse-core/audits/accessibility/aria-roles.js index 6edd7b949eea..42e0f34dd315 100644 --- a/lighthouse-core/audits/accessibility/aria-roles.js +++ b/lighthouse-core/audits/accessibility/aria-roles.js @@ -21,6 +21,7 @@ class AriaRoles extends AxeAudit { category: 'Accessibility', name: 'aria-roles', description: '`[role]` values are valid.', + failureDescription: '`[role]` values are not valid.', helpText: 'ARIA roles must have valid values in order to perform their ' + 'intended accessibility functions. ' + '[Learn more](https://dequeuniversity.com/rules/axe/1.1/aria-roles).', diff --git a/lighthouse-core/audits/accessibility/aria-valid-attr-value.js b/lighthouse-core/audits/accessibility/aria-valid-attr-value.js index 9d3acad7b124..800babafba08 100644 --- a/lighthouse-core/audits/accessibility/aria-valid-attr-value.js +++ b/lighthouse-core/audits/accessibility/aria-valid-attr-value.js @@ -21,6 +21,7 @@ class ARIAValidAttr extends AxeAudit { category: 'Accessibility', name: 'aria-valid-attr-value', description: '`[aria-*]` attributes have valid values.', + failureDescription: '`[aria-*]` attributes do not have valid values.', helpText: 'Assistive technologies, like screen readers, can\'t interpret ARIA ' + 'attributes with invalid values. [Learn ' + 'more](https://developers.google.com/web/tools/lighthouse/audits/valid-aria-values).', diff --git a/lighthouse-core/audits/accessibility/aria-valid-attr.js b/lighthouse-core/audits/accessibility/aria-valid-attr.js index 3ade59f76165..8aa3ea516680 100644 --- a/lighthouse-core/audits/accessibility/aria-valid-attr.js +++ b/lighthouse-core/audits/accessibility/aria-valid-attr.js @@ -21,6 +21,7 @@ class ARIAValidAttr extends AxeAudit { category: 'Accessibility', name: 'aria-valid-attr', description: '`[aria-*]` attributes are valid and not misspelled.', + failureDescription: '`[aria-*]` attributes are not valid or misspelled.', helpText: 'Assistive technologies, like screen readers, can\'t interpret ARIA ' + 'attributes with invalid names. [Learn ' + 'more](https://developers.google.com/web/tools/lighthouse/audits/valid-aria-attributes).', diff --git a/lighthouse-core/audits/accessibility/audio-caption.js b/lighthouse-core/audits/accessibility/audio-caption.js index 4841b4669468..b02b215dde72 100644 --- a/lighthouse-core/audits/accessibility/audio-caption.js +++ b/lighthouse-core/audits/accessibility/audio-caption.js @@ -21,6 +21,8 @@ class AudioCaption extends AxeAudit { category: 'Accessibility', name: 'audio-caption', description: '`