From 517bf350230550e0aa5a26a2c1fed006399dac63 Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Wed, 11 May 2022 13:46:10 -0700 Subject: [PATCH 1/2] tests(fr): snapshot audit ids in api test --- .../__snapshots__/api-test-pptr.js.snap | 528 ++++++++++++++++++ .../fraggle-rock/scenarios/api-test-pptr.js | 18 +- 2 files changed, 535 insertions(+), 11 deletions(-) create mode 100644 lighthouse-core/test/fraggle-rock/scenarios/__snapshots__/api-test-pptr.js.snap diff --git a/lighthouse-core/test/fraggle-rock/scenarios/__snapshots__/api-test-pptr.js.snap b/lighthouse-core/test/fraggle-rock/scenarios/__snapshots__/api-test-pptr.js.snap new file mode 100644 index 000000000000..90ebb6d41dc1 --- /dev/null +++ b/lighthouse-core/test/fraggle-rock/scenarios/__snapshots__/api-test-pptr.js.snap @@ -0,0 +1,528 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Fraggle Rock API navigation should compute both snapshot & timespan results 1`] = ` +Array [ + "is-on-https", + "service-worker", + "viewport", + "first-contentful-paint", + "largest-contentful-paint", + "first-meaningful-paint", + "speed-index", + "screenshot-thumbnails", + "final-screenshot", + "total-blocking-time", + "max-potential-fid", + "cumulative-layout-shift", + "errors-in-console", + "server-response-time", + "interactive", + "user-timings", + "critical-request-chains", + "redirects", + "installable-manifest", + "apple-touch-icon", + "splash-screen", + "themed-omnibox", + "maskable-icon", + "content-width", + "image-aspect-ratio", + "image-size-responsive", + "preload-fonts", + "deprecations", + "mainthread-work-breakdown", + "bootup-time", + "uses-rel-preload", + "uses-rel-preconnect", + "font-display", + "diagnostics", + "network-requests", + "network-rtt", + "network-server-latency", + "main-thread-tasks", + "metrics", + "performance-budget", + "timing-budget", + "resource-summary", + "third-party-summary", + "third-party-facades", + "largest-contentful-paint-element", + "lcp-lazy-loaded", + "layout-shift-elements", + "long-tasks", + "no-unload-listeners", + "non-composited-animations", + "unsized-images", + "valid-source-maps", + "preload-lcp-image", + "csp-xss", + "full-page-screenshot", + "script-treemap-data", + "pwa-cross-browser", + "pwa-page-transitions", + "pwa-each-page-has-url", + "accesskeys", + "aria-allowed-attr", + "aria-command-name", + "aria-hidden-body", + "aria-hidden-focus", + "aria-input-field-name", + "aria-meter-name", + "aria-progressbar-name", + "aria-required-attr", + "aria-required-children", + "aria-required-parent", + "aria-roles", + "aria-toggle-field-name", + "aria-tooltip-name", + "aria-treeitem-name", + "aria-valid-attr-value", + "aria-valid-attr", + "button-name", + "bypass", + "color-contrast", + "definition-list", + "dlitem", + "document-title", + "duplicate-id-active", + "duplicate-id-aria", + "form-field-multiple-labels", + "frame-title", + "heading-order", + "html-has-lang", + "html-lang-valid", + "image-alt", + "input-image-alt", + "label", + "link-name", + "list", + "listitem", + "meta-refresh", + "meta-viewport", + "object-alt", + "tabindex", + "td-headers-attr", + "th-has-data-cells", + "valid-lang", + "video-caption", + "custom-controls-labels", + "custom-controls-roles", + "focus-traps", + "focusable-controls", + "interactive-element-affordance", + "logical-tab-order", + "managed-focus", + "offscreen-content-hidden", + "use-landmarks", + "visual-order-follows-dom", + "uses-long-cache-ttl", + "total-byte-weight", + "offscreen-images", + "render-blocking-resources", + "unminified-css", + "unminified-javascript", + "unused-css-rules", + "unused-javascript", + "modern-image-formats", + "uses-optimized-images", + "uses-text-compression", + "uses-responsive-images", + "efficient-animated-content", + "duplicated-javascript", + "legacy-javascript", + "doctype", + "charset", + "dom-size", + "geolocation-on-start", + "inspector-issues", + "no-document-write", + "no-vulnerable-libraries", + "js-libraries", + "notification-on-start", + "password-inputs-can-be-pasted-into", + "uses-http2", + "uses-passive-event-listeners", + "meta-description", + "http-status-code", + "font-size", + "link-text", + "crawlable-anchors", + "is-crawlable", + "robots-txt", + "tap-targets", + "hreflang", + "plugins", + "canonical", + "structured-data", +] +`; + +exports[`Fraggle Rock API navigation should compute results with callback requestor 1`] = ` +Array [ + "is-on-https", + "service-worker", + "viewport", + "first-contentful-paint", + "largest-contentful-paint", + "first-meaningful-paint", + "speed-index", + "screenshot-thumbnails", + "final-screenshot", + "total-blocking-time", + "max-potential-fid", + "cumulative-layout-shift", + "errors-in-console", + "server-response-time", + "interactive", + "user-timings", + "critical-request-chains", + "redirects", + "installable-manifest", + "apple-touch-icon", + "splash-screen", + "themed-omnibox", + "maskable-icon", + "content-width", + "image-aspect-ratio", + "image-size-responsive", + "preload-fonts", + "deprecations", + "mainthread-work-breakdown", + "bootup-time", + "uses-rel-preload", + "uses-rel-preconnect", + "font-display", + "diagnostics", + "network-requests", + "network-rtt", + "network-server-latency", + "main-thread-tasks", + "metrics", + "performance-budget", + "timing-budget", + "resource-summary", + "third-party-summary", + "third-party-facades", + "largest-contentful-paint-element", + "lcp-lazy-loaded", + "layout-shift-elements", + "long-tasks", + "no-unload-listeners", + "non-composited-animations", + "unsized-images", + "valid-source-maps", + "preload-lcp-image", + "csp-xss", + "full-page-screenshot", + "script-treemap-data", + "pwa-cross-browser", + "pwa-page-transitions", + "pwa-each-page-has-url", + "accesskeys", + "aria-allowed-attr", + "aria-command-name", + "aria-hidden-body", + "aria-hidden-focus", + "aria-input-field-name", + "aria-meter-name", + "aria-progressbar-name", + "aria-required-attr", + "aria-required-children", + "aria-required-parent", + "aria-roles", + "aria-toggle-field-name", + "aria-tooltip-name", + "aria-treeitem-name", + "aria-valid-attr-value", + "aria-valid-attr", + "button-name", + "bypass", + "color-contrast", + "definition-list", + "dlitem", + "document-title", + "duplicate-id-active", + "duplicate-id-aria", + "form-field-multiple-labels", + "frame-title", + "heading-order", + "html-has-lang", + "html-lang-valid", + "image-alt", + "input-image-alt", + "label", + "link-name", + "list", + "listitem", + "meta-refresh", + "meta-viewport", + "object-alt", + "tabindex", + "td-headers-attr", + "th-has-data-cells", + "valid-lang", + "video-caption", + "custom-controls-labels", + "custom-controls-roles", + "focus-traps", + "focusable-controls", + "interactive-element-affordance", + "logical-tab-order", + "managed-focus", + "offscreen-content-hidden", + "use-landmarks", + "visual-order-follows-dom", + "uses-long-cache-ttl", + "total-byte-weight", + "offscreen-images", + "render-blocking-resources", + "unminified-css", + "unminified-javascript", + "unused-css-rules", + "unused-javascript", + "modern-image-formats", + "uses-optimized-images", + "uses-text-compression", + "uses-responsive-images", + "efficient-animated-content", + "duplicated-javascript", + "legacy-javascript", + "doctype", + "charset", + "dom-size", + "geolocation-on-start", + "inspector-issues", + "no-document-write", + "no-vulnerable-libraries", + "js-libraries", + "notification-on-start", + "password-inputs-can-be-pasted-into", + "uses-http2", + "uses-passive-event-listeners", + "meta-description", + "http-status-code", + "font-size", + "link-text", + "crawlable-anchors", + "is-crawlable", + "robots-txt", + "tap-targets", + "hreflang", + "plugins", + "canonical", + "structured-data", +] +`; + +exports[`Fraggle Rock API snapshot should compute accessibility results on the page as-is 1`] = ` +Array [ + "viewport", + "image-aspect-ratio", + "image-size-responsive", + "unsized-images", + "full-page-screenshot", + "accesskeys", + "aria-allowed-attr", + "aria-command-name", + "aria-hidden-body", + "aria-hidden-focus", + "aria-input-field-name", + "aria-meter-name", + "aria-progressbar-name", + "aria-required-attr", + "aria-required-children", + "aria-required-parent", + "aria-roles", + "aria-toggle-field-name", + "aria-tooltip-name", + "aria-treeitem-name", + "aria-valid-attr-value", + "aria-valid-attr", + "button-name", + "bypass", + "color-contrast", + "definition-list", + "dlitem", + "document-title", + "duplicate-id-active", + "duplicate-id-aria", + "form-field-multiple-labels", + "frame-title", + "heading-order", + "html-has-lang", + "html-lang-valid", + "image-alt", + "input-image-alt", + "label", + "link-name", + "list", + "listitem", + "meta-refresh", + "meta-viewport", + "object-alt", + "tabindex", + "td-headers-attr", + "th-has-data-cells", + "valid-lang", + "video-caption", + "custom-controls-labels", + "custom-controls-roles", + "focus-traps", + "focusable-controls", + "interactive-element-affordance", + "logical-tab-order", + "managed-focus", + "offscreen-content-hidden", + "use-landmarks", + "visual-order-follows-dom", + "doctype", + "dom-size", + "no-vulnerable-libraries", + "js-libraries", + "password-inputs-can-be-pasted-into", + "meta-description", + "font-size", + "link-text", + "crawlable-anchors", + "robots-txt", + "tap-targets", + "plugins", + "structured-data", + "uses-responsive-images-snapshot", +] +`; + +exports[`Fraggle Rock API startTimespan should compute ConsoleMessage results across a span of time 1`] = ` +Array [ + "is-on-https", + "screenshot-thumbnails", + "final-screenshot", + "total-blocking-time", + "cumulative-layout-shift", + "errors-in-console", + "user-timings", + "image-aspect-ratio", + "image-size-responsive", + "preload-fonts", + "deprecations", + "mainthread-work-breakdown", + "bootup-time", + "network-requests", + "network-rtt", + "network-server-latency", + "main-thread-tasks", + "resource-summary", + "third-party-summary", + "layout-shift-elements", + "long-tasks", + "no-unload-listeners", + "non-composited-animations", + "unsized-images", + "valid-source-maps", + "full-page-screenshot", + "script-treemap-data", + "uses-long-cache-ttl", + "total-byte-weight", + "unminified-css", + "unminified-javascript", + "unused-css-rules", + "unused-javascript", + "modern-image-formats", + "uses-optimized-images", + "uses-text-compression", + "uses-responsive-images", + "efficient-animated-content", + "duplicated-javascript", + "legacy-javascript", + "inspector-issues", + "no-document-write", + "uses-http2", + "uses-passive-event-listeners", + "experimental-interaction-to-next-paint", + "work-during-interaction", +] +`; + +exports[`Fraggle Rock API startTimespan should compute ConsoleMessage results across a span of time 2`] = ` +Array [ + "user-timings", + "preload-fonts", + "third-party-summary", + "non-composited-animations", + "unsized-images", +] +`; + +exports[`Fraggle Rock API startTimespan should compute results from timespan after page load 1`] = ` +Array [ + "is-on-https", + "screenshot-thumbnails", + "final-screenshot", + "total-blocking-time", + "cumulative-layout-shift", + "errors-in-console", + "user-timings", + "image-aspect-ratio", + "image-size-responsive", + "preload-fonts", + "deprecations", + "mainthread-work-breakdown", + "bootup-time", + "network-requests", + "network-rtt", + "network-server-latency", + "main-thread-tasks", + "resource-summary", + "third-party-summary", + "layout-shift-elements", + "long-tasks", + "no-unload-listeners", + "non-composited-animations", + "unsized-images", + "valid-source-maps", + "full-page-screenshot", + "script-treemap-data", + "uses-long-cache-ttl", + "total-byte-weight", + "unminified-css", + "unminified-javascript", + "unused-css-rules", + "unused-javascript", + "modern-image-formats", + "uses-optimized-images", + "uses-text-compression", + "uses-responsive-images", + "efficient-animated-content", + "duplicated-javascript", + "legacy-javascript", + "inspector-issues", + "no-document-write", + "uses-http2", + "uses-passive-event-listeners", + "experimental-interaction-to-next-paint", + "work-during-interaction", +] +`; + +exports[`Fraggle Rock API startTimespan should compute results from timespan after page load 2`] = ` +Array [ + "user-timings", + "preload-fonts", + "network-rtt", + "network-server-latency", + "third-party-summary", + "non-composited-animations", + "unsized-images", + "unminified-css", + "unminified-javascript", + "unused-css-rules", + "unused-javascript", + "modern-image-formats", + "uses-optimized-images", + "uses-text-compression", + "uses-responsive-images", + "efficient-animated-content", + "duplicated-javascript", + "legacy-javascript", +] +`; diff --git a/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js b/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js index d86d754d7d15..7b054c775a89 100644 --- a/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js +++ b/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js @@ -50,8 +50,7 @@ describe('Fraggle Rock API', () => { expect(accessibility.score).toBeLessThan(1); const {auditResults, erroredAudits, failedAudits} = getAuditsBreakdown(lhr); - // TODO(FR-COMPAT): This assertion can be removed when full compatibility is reached. - expect(auditResults.length).toMatchInlineSnapshot(`73`); + expect(auditResults.map(audit => audit.id)).toMatchSnapshot(); expect(erroredAudits).toHaveLength(0); expect(failedAudits.map(audit => audit.id)).toContain('label'); @@ -90,10 +89,9 @@ describe('Fraggle Rock API', () => { failedAudits, notApplicableAudits, } = getAuditsBreakdown(lhr); - // TODO(FR-COMPAT): This assertion can be removed when full compatibility is reached. - expect(auditResults.length).toMatchInlineSnapshot(`46`); + expect(auditResults.map(audit => audit.id)).toMatchSnapshot(); - expect(notApplicableAudits.length).toMatchInlineSnapshot(`5`); + expect(notApplicableAudits.map(audit => audit.id)).toMatchSnapshot(); expect(notApplicableAudits.map(audit => audit.id)).not.toContain('total-blocking-time'); expect(erroredAudits).toHaveLength(0); @@ -143,9 +141,9 @@ describe('Fraggle Rock API', () => { }); const {auditResults, erroredAudits, notApplicableAudits} = getAuditsBreakdown(result.lhr); - expect(auditResults.length).toMatchInlineSnapshot(`46`); + expect(auditResults.map(audit => audit.id)).toMatchSnapshot(); - expect(notApplicableAudits.length).toMatchInlineSnapshot(`18`); + expect(notApplicableAudits.map(audit => audit.id)).toMatchSnapshot(); expect(notApplicableAudits.map(audit => audit.id)).not.toContain('total-blocking-time'); expect(erroredAudits).toHaveLength(0); @@ -173,8 +171,7 @@ describe('Fraggle Rock API', () => { }); const {auditResults, failedAudits, erroredAudits} = getAuditsBreakdown(lhr); - // TODO(FR-COMPAT): This assertion can be removed when full compatibility is reached. - expect(auditResults.length).toMatchInlineSnapshot(`152`); + expect(auditResults.map(audit => audit.id)).toMatchSnapshot(); expect(erroredAudits).toHaveLength(0); const failedAuditIds = failedAudits.map(audit => audit.id); @@ -219,8 +216,7 @@ describe('Fraggle Rock API', () => { }); const {auditResults, failedAudits, erroredAudits} = getAuditsBreakdown(lhr); - // TODO(FR-COMPAT): This assertion can be removed when full compatibility is reached. - expect(auditResults.length).toMatchInlineSnapshot(`152`); + expect(auditResults.map(audit => audit.id)).toMatchSnapshot(); expect(erroredAudits).toHaveLength(0); const failedAuditIds = failedAudits.map(audit => audit.id); From d8fcccb5e9c98660c5d8bebe02946f3591e392df Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Wed, 11 May 2022 14:06:21 -0700 Subject: [PATCH 2/2] sort --- .../__snapshots__/api-test-pptr.js.snap | 604 +++++++++--------- .../fraggle-rock/scenarios/api-test-pptr.js | 14 +- 2 files changed, 309 insertions(+), 309 deletions(-) diff --git a/lighthouse-core/test/fraggle-rock/scenarios/__snapshots__/api-test-pptr.js.snap b/lighthouse-core/test/fraggle-rock/scenarios/__snapshots__/api-test-pptr.js.snap index 90ebb6d41dc1..8d568309771e 100644 --- a/lighthouse-core/test/fraggle-rock/scenarios/__snapshots__/api-test-pptr.js.snap +++ b/lighthouse-core/test/fraggle-rock/scenarios/__snapshots__/api-test-pptr.js.snap @@ -2,66 +2,8 @@ exports[`Fraggle Rock API navigation should compute both snapshot & timespan results 1`] = ` Array [ - "is-on-https", - "service-worker", - "viewport", - "first-contentful-paint", - "largest-contentful-paint", - "first-meaningful-paint", - "speed-index", - "screenshot-thumbnails", - "final-screenshot", - "total-blocking-time", - "max-potential-fid", - "cumulative-layout-shift", - "errors-in-console", - "server-response-time", - "interactive", - "user-timings", - "critical-request-chains", - "redirects", - "installable-manifest", - "apple-touch-icon", - "splash-screen", - "themed-omnibox", - "maskable-icon", - "content-width", - "image-aspect-ratio", - "image-size-responsive", - "preload-fonts", - "deprecations", - "mainthread-work-breakdown", - "bootup-time", - "uses-rel-preload", - "uses-rel-preconnect", - "font-display", - "diagnostics", - "network-requests", - "network-rtt", - "network-server-latency", - "main-thread-tasks", - "metrics", - "performance-budget", - "timing-budget", - "resource-summary", - "third-party-summary", - "third-party-facades", - "largest-contentful-paint-element", - "lcp-lazy-loaded", - "layout-shift-elements", - "long-tasks", - "no-unload-listeners", - "non-composited-animations", - "unsized-images", - "valid-source-maps", - "preload-lcp-image", - "csp-xss", - "full-page-screenshot", - "script-treemap-data", - "pwa-cross-browser", - "pwa-page-transitions", - "pwa-each-page-has-url", "accesskeys", + "apple-touch-icon", "aria-allowed-attr", "aria-command-name", "aria-hidden-body", @@ -76,149 +18,149 @@ Array [ "aria-toggle-field-name", "aria-tooltip-name", "aria-treeitem-name", - "aria-valid-attr-value", "aria-valid-attr", + "aria-valid-attr-value", + "bootup-time", "button-name", "bypass", + "canonical", + "charset", "color-contrast", + "content-width", + "crawlable-anchors", + "critical-request-chains", + "csp-xss", + "cumulative-layout-shift", + "custom-controls-labels", + "custom-controls-roles", "definition-list", + "deprecations", + "diagnostics", "dlitem", + "doctype", "document-title", + "dom-size", "duplicate-id-active", "duplicate-id-aria", + "duplicated-javascript", + "efficient-animated-content", + "errors-in-console", + "final-screenshot", + "first-contentful-paint", + "first-meaningful-paint", + "focus-traps", + "focusable-controls", + "font-display", + "font-size", "form-field-multiple-labels", "frame-title", + "full-page-screenshot", + "geolocation-on-start", "heading-order", + "hreflang", "html-has-lang", "html-lang-valid", + "http-status-code", "image-alt", + "image-aspect-ratio", + "image-size-responsive", "input-image-alt", + "inspector-issues", + "installable-manifest", + "interactive", + "interactive-element-affordance", + "is-crawlable", + "is-on-https", + "js-libraries", "label", + "largest-contentful-paint", + "largest-contentful-paint-element", + "layout-shift-elements", + "lcp-lazy-loaded", + "legacy-javascript", "link-name", + "link-text", "list", "listitem", + "logical-tab-order", + "long-tasks", + "main-thread-tasks", + "mainthread-work-breakdown", + "managed-focus", + "maskable-icon", + "max-potential-fid", + "meta-description", "meta-refresh", "meta-viewport", + "metrics", + "modern-image-formats", + "network-requests", + "network-rtt", + "network-server-latency", + "no-document-write", + "no-unload-listeners", + "no-vulnerable-libraries", + "non-composited-animations", + "notification-on-start", "object-alt", + "offscreen-content-hidden", + "offscreen-images", + "password-inputs-can-be-pasted-into", + "performance-budget", + "plugins", + "preload-fonts", + "preload-lcp-image", + "pwa-cross-browser", + "pwa-each-page-has-url", + "pwa-page-transitions", + "redirects", + "render-blocking-resources", + "resource-summary", + "robots-txt", + "screenshot-thumbnails", + "script-treemap-data", + "server-response-time", + "service-worker", + "speed-index", + "splash-screen", + "structured-data", "tabindex", + "tap-targets", "td-headers-attr", "th-has-data-cells", - "valid-lang", - "video-caption", - "custom-controls-labels", - "custom-controls-roles", - "focus-traps", - "focusable-controls", - "interactive-element-affordance", - "logical-tab-order", - "managed-focus", - "offscreen-content-hidden", - "use-landmarks", - "visual-order-follows-dom", - "uses-long-cache-ttl", + "themed-omnibox", + "third-party-facades", + "third-party-summary", + "timing-budget", + "total-blocking-time", "total-byte-weight", - "offscreen-images", - "render-blocking-resources", "unminified-css", "unminified-javascript", + "unsized-images", "unused-css-rules", "unused-javascript", - "modern-image-formats", - "uses-optimized-images", - "uses-text-compression", - "uses-responsive-images", - "efficient-animated-content", - "duplicated-javascript", - "legacy-javascript", - "doctype", - "charset", - "dom-size", - "geolocation-on-start", - "inspector-issues", - "no-document-write", - "no-vulnerable-libraries", - "js-libraries", - "notification-on-start", - "password-inputs-can-be-pasted-into", + "use-landmarks", + "user-timings", "uses-http2", + "uses-long-cache-ttl", + "uses-optimized-images", "uses-passive-event-listeners", - "meta-description", - "http-status-code", - "font-size", - "link-text", - "crawlable-anchors", - "is-crawlable", - "robots-txt", - "tap-targets", - "hreflang", - "plugins", - "canonical", - "structured-data", + "uses-rel-preconnect", + "uses-rel-preload", + "uses-responsive-images", + "uses-text-compression", + "valid-lang", + "valid-source-maps", + "video-caption", + "viewport", + "visual-order-follows-dom", ] `; exports[`Fraggle Rock API navigation should compute results with callback requestor 1`] = ` Array [ - "is-on-https", - "service-worker", - "viewport", - "first-contentful-paint", - "largest-contentful-paint", - "first-meaningful-paint", - "speed-index", - "screenshot-thumbnails", - "final-screenshot", - "total-blocking-time", - "max-potential-fid", - "cumulative-layout-shift", - "errors-in-console", - "server-response-time", - "interactive", - "user-timings", - "critical-request-chains", - "redirects", - "installable-manifest", - "apple-touch-icon", - "splash-screen", - "themed-omnibox", - "maskable-icon", - "content-width", - "image-aspect-ratio", - "image-size-responsive", - "preload-fonts", - "deprecations", - "mainthread-work-breakdown", - "bootup-time", - "uses-rel-preload", - "uses-rel-preconnect", - "font-display", - "diagnostics", - "network-requests", - "network-rtt", - "network-server-latency", - "main-thread-tasks", - "metrics", - "performance-budget", - "timing-budget", - "resource-summary", - "third-party-summary", - "third-party-facades", - "largest-contentful-paint-element", - "lcp-lazy-loaded", - "layout-shift-elements", - "long-tasks", - "no-unload-listeners", - "non-composited-animations", - "unsized-images", - "valid-source-maps", - "preload-lcp-image", - "csp-xss", - "full-page-screenshot", - "script-treemap-data", - "pwa-cross-browser", - "pwa-page-transitions", - "pwa-each-page-has-url", "accesskeys", + "apple-touch-icon", "aria-allowed-attr", "aria-command-name", "aria-hidden-body", @@ -233,94 +175,147 @@ Array [ "aria-toggle-field-name", "aria-tooltip-name", "aria-treeitem-name", - "aria-valid-attr-value", "aria-valid-attr", + "aria-valid-attr-value", + "bootup-time", "button-name", "bypass", + "canonical", + "charset", "color-contrast", + "content-width", + "crawlable-anchors", + "critical-request-chains", + "csp-xss", + "cumulative-layout-shift", + "custom-controls-labels", + "custom-controls-roles", "definition-list", + "deprecations", + "diagnostics", "dlitem", + "doctype", "document-title", + "dom-size", "duplicate-id-active", "duplicate-id-aria", + "duplicated-javascript", + "efficient-animated-content", + "errors-in-console", + "final-screenshot", + "first-contentful-paint", + "first-meaningful-paint", + "focus-traps", + "focusable-controls", + "font-display", + "font-size", "form-field-multiple-labels", "frame-title", + "full-page-screenshot", + "geolocation-on-start", "heading-order", + "hreflang", "html-has-lang", "html-lang-valid", + "http-status-code", "image-alt", + "image-aspect-ratio", + "image-size-responsive", "input-image-alt", + "inspector-issues", + "installable-manifest", + "interactive", + "interactive-element-affordance", + "is-crawlable", + "is-on-https", + "js-libraries", "label", + "largest-contentful-paint", + "largest-contentful-paint-element", + "layout-shift-elements", + "lcp-lazy-loaded", + "legacy-javascript", "link-name", + "link-text", "list", "listitem", + "logical-tab-order", + "long-tasks", + "main-thread-tasks", + "mainthread-work-breakdown", + "managed-focus", + "maskable-icon", + "max-potential-fid", + "meta-description", "meta-refresh", "meta-viewport", + "metrics", + "modern-image-formats", + "network-requests", + "network-rtt", + "network-server-latency", + "no-document-write", + "no-unload-listeners", + "no-vulnerable-libraries", + "non-composited-animations", + "notification-on-start", "object-alt", + "offscreen-content-hidden", + "offscreen-images", + "password-inputs-can-be-pasted-into", + "performance-budget", + "plugins", + "preload-fonts", + "preload-lcp-image", + "pwa-cross-browser", + "pwa-each-page-has-url", + "pwa-page-transitions", + "redirects", + "render-blocking-resources", + "resource-summary", + "robots-txt", + "screenshot-thumbnails", + "script-treemap-data", + "server-response-time", + "service-worker", + "speed-index", + "splash-screen", + "structured-data", "tabindex", + "tap-targets", "td-headers-attr", "th-has-data-cells", - "valid-lang", - "video-caption", - "custom-controls-labels", - "custom-controls-roles", - "focus-traps", - "focusable-controls", - "interactive-element-affordance", - "logical-tab-order", - "managed-focus", - "offscreen-content-hidden", - "use-landmarks", - "visual-order-follows-dom", - "uses-long-cache-ttl", + "themed-omnibox", + "third-party-facades", + "third-party-summary", + "timing-budget", + "total-blocking-time", "total-byte-weight", - "offscreen-images", - "render-blocking-resources", "unminified-css", "unminified-javascript", + "unsized-images", "unused-css-rules", "unused-javascript", - "modern-image-formats", - "uses-optimized-images", - "uses-text-compression", - "uses-responsive-images", - "efficient-animated-content", - "duplicated-javascript", - "legacy-javascript", - "doctype", - "charset", - "dom-size", - "geolocation-on-start", - "inspector-issues", - "no-document-write", - "no-vulnerable-libraries", - "js-libraries", - "notification-on-start", - "password-inputs-can-be-pasted-into", + "use-landmarks", + "user-timings", "uses-http2", + "uses-long-cache-ttl", + "uses-optimized-images", "uses-passive-event-listeners", - "meta-description", - "http-status-code", - "font-size", - "link-text", - "crawlable-anchors", - "is-crawlable", - "robots-txt", - "tap-targets", - "hreflang", - "plugins", - "canonical", - "structured-data", + "uses-rel-preconnect", + "uses-rel-preload", + "uses-responsive-images", + "uses-text-compression", + "valid-lang", + "valid-source-maps", + "video-caption", + "viewport", + "visual-order-follows-dom", ] `; exports[`Fraggle Rock API snapshot should compute accessibility results on the page as-is 1`] = ` Array [ - "viewport", - "image-aspect-ratio", - "image-size-responsive", - "unsized-images", - "full-page-screenshot", "accesskeys", "aria-allowed-attr", "aria-command-name", @@ -336,193 +331,198 @@ Array [ "aria-toggle-field-name", "aria-tooltip-name", "aria-treeitem-name", - "aria-valid-attr-value", "aria-valid-attr", + "aria-valid-attr-value", "button-name", "bypass", "color-contrast", + "crawlable-anchors", + "custom-controls-labels", + "custom-controls-roles", "definition-list", "dlitem", + "doctype", "document-title", + "dom-size", "duplicate-id-active", "duplicate-id-aria", + "focus-traps", + "focusable-controls", + "font-size", "form-field-multiple-labels", "frame-title", + "full-page-screenshot", "heading-order", "html-has-lang", "html-lang-valid", "image-alt", + "image-aspect-ratio", + "image-size-responsive", "input-image-alt", + "interactive-element-affordance", + "js-libraries", "label", "link-name", + "link-text", "list", "listitem", + "logical-tab-order", + "managed-focus", + "meta-description", "meta-refresh", "meta-viewport", + "no-vulnerable-libraries", "object-alt", + "offscreen-content-hidden", + "password-inputs-can-be-pasted-into", + "plugins", + "robots-txt", + "structured-data", "tabindex", + "tap-targets", "td-headers-attr", "th-has-data-cells", + "unsized-images", + "use-landmarks", + "uses-responsive-images-snapshot", "valid-lang", "video-caption", - "custom-controls-labels", - "custom-controls-roles", - "focus-traps", - "focusable-controls", - "interactive-element-affordance", - "logical-tab-order", - "managed-focus", - "offscreen-content-hidden", - "use-landmarks", + "viewport", "visual-order-follows-dom", - "doctype", - "dom-size", - "no-vulnerable-libraries", - "js-libraries", - "password-inputs-can-be-pasted-into", - "meta-description", - "font-size", - "link-text", - "crawlable-anchors", - "robots-txt", - "tap-targets", - "plugins", - "structured-data", - "uses-responsive-images-snapshot", ] `; exports[`Fraggle Rock API startTimespan should compute ConsoleMessage results across a span of time 1`] = ` Array [ - "is-on-https", - "screenshot-thumbnails", - "final-screenshot", - "total-blocking-time", + "bootup-time", "cumulative-layout-shift", + "deprecations", + "duplicated-javascript", + "efficient-animated-content", "errors-in-console", - "user-timings", + "experimental-interaction-to-next-paint", + "final-screenshot", + "full-page-screenshot", "image-aspect-ratio", "image-size-responsive", - "preload-fonts", - "deprecations", + "inspector-issues", + "is-on-https", + "layout-shift-elements", + "legacy-javascript", + "long-tasks", + "main-thread-tasks", "mainthread-work-breakdown", - "bootup-time", + "modern-image-formats", "network-requests", "network-rtt", "network-server-latency", - "main-thread-tasks", - "resource-summary", - "third-party-summary", - "layout-shift-elements", - "long-tasks", + "no-document-write", "no-unload-listeners", "non-composited-animations", - "unsized-images", - "valid-source-maps", - "full-page-screenshot", + "preload-fonts", + "resource-summary", + "screenshot-thumbnails", "script-treemap-data", - "uses-long-cache-ttl", + "third-party-summary", + "total-blocking-time", "total-byte-weight", "unminified-css", "unminified-javascript", + "unsized-images", "unused-css-rules", "unused-javascript", - "modern-image-formats", - "uses-optimized-images", - "uses-text-compression", - "uses-responsive-images", - "efficient-animated-content", - "duplicated-javascript", - "legacy-javascript", - "inspector-issues", - "no-document-write", + "user-timings", "uses-http2", + "uses-long-cache-ttl", + "uses-optimized-images", "uses-passive-event-listeners", - "experimental-interaction-to-next-paint", + "uses-responsive-images", + "uses-text-compression", + "valid-source-maps", "work-during-interaction", ] `; exports[`Fraggle Rock API startTimespan should compute ConsoleMessage results across a span of time 2`] = ` Array [ - "user-timings", + "non-composited-animations", "preload-fonts", "third-party-summary", - "non-composited-animations", "unsized-images", + "user-timings", ] `; exports[`Fraggle Rock API startTimespan should compute results from timespan after page load 1`] = ` Array [ - "is-on-https", - "screenshot-thumbnails", - "final-screenshot", - "total-blocking-time", + "bootup-time", "cumulative-layout-shift", + "deprecations", + "duplicated-javascript", + "efficient-animated-content", "errors-in-console", - "user-timings", + "experimental-interaction-to-next-paint", + "final-screenshot", + "full-page-screenshot", "image-aspect-ratio", "image-size-responsive", - "preload-fonts", - "deprecations", + "inspector-issues", + "is-on-https", + "layout-shift-elements", + "legacy-javascript", + "long-tasks", + "main-thread-tasks", "mainthread-work-breakdown", - "bootup-time", + "modern-image-formats", "network-requests", "network-rtt", "network-server-latency", - "main-thread-tasks", - "resource-summary", - "third-party-summary", - "layout-shift-elements", - "long-tasks", + "no-document-write", "no-unload-listeners", "non-composited-animations", - "unsized-images", - "valid-source-maps", - "full-page-screenshot", + "preload-fonts", + "resource-summary", + "screenshot-thumbnails", "script-treemap-data", - "uses-long-cache-ttl", + "third-party-summary", + "total-blocking-time", "total-byte-weight", "unminified-css", "unminified-javascript", + "unsized-images", "unused-css-rules", "unused-javascript", - "modern-image-formats", - "uses-optimized-images", - "uses-text-compression", - "uses-responsive-images", - "efficient-animated-content", - "duplicated-javascript", - "legacy-javascript", - "inspector-issues", - "no-document-write", + "user-timings", "uses-http2", + "uses-long-cache-ttl", + "uses-optimized-images", "uses-passive-event-listeners", - "experimental-interaction-to-next-paint", + "uses-responsive-images", + "uses-text-compression", + "valid-source-maps", "work-during-interaction", ] `; exports[`Fraggle Rock API startTimespan should compute results from timespan after page load 2`] = ` Array [ - "user-timings", - "preload-fonts", + "duplicated-javascript", + "efficient-animated-content", + "legacy-javascript", + "modern-image-formats", "network-rtt", "network-server-latency", - "third-party-summary", "non-composited-animations", - "unsized-images", + "preload-fonts", + "third-party-summary", "unminified-css", "unminified-javascript", + "unsized-images", "unused-css-rules", "unused-javascript", - "modern-image-formats", + "user-timings", "uses-optimized-images", - "uses-text-compression", "uses-responsive-images", - "efficient-animated-content", - "duplicated-javascript", - "legacy-javascript", + "uses-text-compression", ] `; diff --git a/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js b/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js index 7b054c775a89..e295401f6912 100644 --- a/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js +++ b/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js @@ -50,7 +50,7 @@ describe('Fraggle Rock API', () => { expect(accessibility.score).toBeLessThan(1); const {auditResults, erroredAudits, failedAudits} = getAuditsBreakdown(lhr); - expect(auditResults.map(audit => audit.id)).toMatchSnapshot(); + expect(auditResults.map(audit => audit.id).sort()).toMatchSnapshot(); expect(erroredAudits).toHaveLength(0); expect(failedAudits.map(audit => audit.id)).toContain('label'); @@ -89,9 +89,9 @@ describe('Fraggle Rock API', () => { failedAudits, notApplicableAudits, } = getAuditsBreakdown(lhr); - expect(auditResults.map(audit => audit.id)).toMatchSnapshot(); + expect(auditResults.map(audit => audit.id).sort()).toMatchSnapshot(); - expect(notApplicableAudits.map(audit => audit.id)).toMatchSnapshot(); + expect(notApplicableAudits.map(audit => audit.id).sort()).toMatchSnapshot(); expect(notApplicableAudits.map(audit => audit.id)).not.toContain('total-blocking-time'); expect(erroredAudits).toHaveLength(0); @@ -141,9 +141,9 @@ describe('Fraggle Rock API', () => { }); const {auditResults, erroredAudits, notApplicableAudits} = getAuditsBreakdown(result.lhr); - expect(auditResults.map(audit => audit.id)).toMatchSnapshot(); + expect(auditResults.map(audit => audit.id).sort()).toMatchSnapshot(); - expect(notApplicableAudits.map(audit => audit.id)).toMatchSnapshot(); + expect(notApplicableAudits.map(audit => audit.id).sort()).toMatchSnapshot(); expect(notApplicableAudits.map(audit => audit.id)).not.toContain('total-blocking-time'); expect(erroredAudits).toHaveLength(0); @@ -171,7 +171,7 @@ describe('Fraggle Rock API', () => { }); const {auditResults, failedAudits, erroredAudits} = getAuditsBreakdown(lhr); - expect(auditResults.map(audit => audit.id)).toMatchSnapshot(); + expect(auditResults.map(audit => audit.id).sort()).toMatchSnapshot(); expect(erroredAudits).toHaveLength(0); const failedAuditIds = failedAudits.map(audit => audit.id); @@ -216,7 +216,7 @@ describe('Fraggle Rock API', () => { }); const {auditResults, failedAudits, erroredAudits} = getAuditsBreakdown(lhr); - expect(auditResults.map(audit => audit.id)).toMatchSnapshot(); + expect(auditResults.map(audit => audit.id).sort()).toMatchSnapshot(); expect(erroredAudits).toHaveLength(0); const failedAuditIds = failedAudits.map(audit => audit.id);