From c593c907db2f21cf0c2016aa934ad1346dbc856f Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Mon, 8 Apr 2024 13:55:14 -0700 Subject: [PATCH 1/5] core(seo): move non-search audits to best practices --- core/config/default-config.js | 6 +- .../reports/sample-flow-result.json | 96 +++++++++---------- core/test/results/sample_v2.json | 34 +++---- 3 files changed, 68 insertions(+), 68 deletions(-) diff --git a/core/config/default-config.js b/core/config/default-config.js index fc328dd7717f..c404c7fcd80e 100644 --- a/core/config/default-config.js +++ b/core/config/default-config.js @@ -583,6 +583,9 @@ const defaultConfig = { {id: 'paste-preventing-inputs', weight: 3, group: 'best-practices-ux'}, {id: 'image-aspect-ratio', weight: 1, group: 'best-practices-ux'}, {id: 'image-size-responsive', weight: 1, group: 'best-practices-ux'}, + {id: 'viewport', weight: 1, group: 'best-practices-ux'}, + {id: 'link-text', weight: 1, group: 'best-practices-ux'}, + {id: 'font-size', weight: 1, group: 'best-practices-ux'}, // Browser Compatibility {id: 'doctype', weight: 1, group: 'best-practices-browser-compat'}, {id: 'charset', weight: 1, group: 'best-practices-browser-compat'}, @@ -601,18 +604,15 @@ const defaultConfig = { manualDescription: str_(UIStrings.seoCategoryManualDescription), supportedModes: ['navigation', 'snapshot'], auditRefs: [ - {id: 'viewport', weight: 1, group: 'seo-mobile'}, {id: 'document-title', weight: 1, group: 'seo-content'}, {id: 'meta-description', weight: 1, group: 'seo-content'}, {id: 'http-status-code', weight: 1, group: 'seo-crawl'}, - {id: 'link-text', weight: 1, group: 'seo-content'}, {id: 'crawlable-anchors', weight: 1, group: 'seo-crawl'}, {id: 'is-crawlable', weight: 1, group: 'seo-crawl'}, {id: 'robots-txt', weight: 1, group: 'seo-crawl'}, {id: 'image-alt', weight: 1, group: 'seo-content'}, {id: 'hreflang', weight: 1, group: 'seo-content'}, {id: 'canonical', weight: 1, group: 'seo-content'}, - {id: 'font-size', weight: 1, group: 'seo-mobile'}, // Manual audits {id: 'structured-data', weight: 0}, ], diff --git a/core/test/fixtures/user-flows/reports/sample-flow-result.json b/core/test/fixtures/user-flows/reports/sample-flow-result.json index 4968d0a4997e..10f62d7487ce 100644 --- a/core/test/fixtures/user-flows/reports/sample-flow-result.json +++ b/core/test/fixtures/user-flows/reports/sample-flow-result.json @@ -4498,6 +4498,21 @@ "weight": 1, "group": "best-practices-ux" }, + { + "id": "viewport", + "weight": 1, + "group": "best-practices-ux" + }, + { + "id": "link-text", + "weight": 1, + "group": "best-practices-ux" + }, + { + "id": "font-size", + "weight": 1, + "group": "best-practices-ux" + }, { "id": "doctype", "weight": 1, @@ -4551,11 +4566,6 @@ "snapshot" ], "auditRefs": [ - { - "id": "viewport", - "weight": 1, - "group": "seo-mobile" - }, { "id": "document-title", "weight": 1, @@ -4571,11 +4581,6 @@ "weight": 1, "group": "seo-crawl" }, - { - "id": "link-text", - "weight": 1, - "group": "seo-content" - }, { "id": "crawlable-anchors", "weight": 1, @@ -4606,11 +4611,6 @@ "weight": 0, "group": "seo-content" }, - { - "id": "font-size", - "weight": 1, - "group": "seo-mobile" - }, { "id": "structured-data", "weight": 0 @@ -15342,6 +15342,21 @@ "weight": 1, "group": "best-practices-ux" }, + { + "id": "viewport", + "weight": 1, + "group": "best-practices-ux" + }, + { + "id": "link-text", + "weight": 1, + "group": "best-practices-ux" + }, + { + "id": "font-size", + "weight": 1, + "group": "best-practices-ux" + }, { "id": "doctype", "weight": 1, @@ -15354,7 +15369,7 @@ } ], "id": "best-practices", - "score": 0.83 + "score": 0.89 }, "seo": { "title": "SEO", @@ -15365,11 +15380,6 @@ "snapshot" ], "auditRefs": [ - { - "id": "viewport", - "weight": 1, - "group": "seo-mobile" - }, { "id": "document-title", "weight": 1, @@ -15380,11 +15390,6 @@ "weight": 1, "group": "seo-content" }, - { - "id": "link-text", - "weight": 1, - "group": "seo-content" - }, { "id": "crawlable-anchors", "weight": 1, @@ -15400,18 +15405,13 @@ "weight": 1, "group": "seo-content" }, - { - "id": "font-size", - "weight": 1, - "group": "seo-mobile" - }, { "id": "structured-data", "weight": 0 } ], "id": "seo", - "score": 0.86 + "score": 0.75 } }, "categoryGroups": { @@ -22166,6 +22166,21 @@ "weight": 1, "group": "best-practices-ux" }, + { + "id": "viewport", + "weight": 1, + "group": "best-practices-ux" + }, + { + "id": "link-text", + "weight": 1, + "group": "best-practices-ux" + }, + { + "id": "font-size", + "weight": 1, + "group": "best-practices-ux" + }, { "id": "doctype", "weight": 1, @@ -22219,11 +22234,6 @@ "snapshot" ], "auditRefs": [ - { - "id": "viewport", - "weight": 1, - "group": "seo-mobile" - }, { "id": "document-title", "weight": 1, @@ -22239,11 +22249,6 @@ "weight": 1, "group": "seo-crawl" }, - { - "id": "link-text", - "weight": 1, - "group": "seo-content" - }, { "id": "crawlable-anchors", "weight": 1, @@ -22274,18 +22279,13 @@ "weight": 0, "group": "seo-content" }, - { - "id": "font-size", - "weight": 1, - "group": "seo-mobile" - }, { "id": "structured-data", "weight": 0 } ], "id": "seo", - "score": 0.9 + "score": 0.86 }, "pwa": { "title": "PWA", diff --git a/core/test/results/sample_v2.json b/core/test/results/sample_v2.json index 9eba323d034a..912c4077a844 100644 --- a/core/test/results/sample_v2.json +++ b/core/test/results/sample_v2.json @@ -6585,6 +6585,21 @@ "weight": 1, "group": "best-practices-ux" }, + { + "id": "viewport", + "weight": 1, + "group": "best-practices-ux" + }, + { + "id": "link-text", + "weight": 1, + "group": "best-practices-ux" + }, + { + "id": "font-size", + "weight": 1, + "group": "best-practices-ux" + }, { "id": "doctype", "weight": 1, @@ -6627,7 +6642,7 @@ } ], "id": "best-practices", - "score": 0.35 + "score": 0.41 }, "seo": { "title": "SEO", @@ -6638,11 +6653,6 @@ "snapshot" ], "auditRefs": [ - { - "id": "viewport", - "weight": 1, - "group": "seo-mobile" - }, { "id": "document-title", "weight": 1, @@ -6658,11 +6668,6 @@ "weight": 1, "group": "seo-crawl" }, - { - "id": "link-text", - "weight": 1, - "group": "seo-content" - }, { "id": "crawlable-anchors", "weight": 1, @@ -6693,18 +6698,13 @@ "weight": 0, "group": "seo-content" }, - { - "id": "font-size", - "weight": 1, - "group": "seo-mobile" - }, { "id": "structured-data", "weight": 0 } ], "id": "seo", - "score": 0.7 + "score": 0.57 }, "pwa": { "title": "PWA", From ca4200b85d1595db6cef44ede68b6f54c703cef5 Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Mon, 8 Apr 2024 16:11:11 -0700 Subject: [PATCH 2/5] unit --- report/test/generator/report-generator-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/report/test/generator/report-generator-test.js b/report/test/generator/report-generator-test.js index e72b9d58e928..f412e77ebbaa 100644 --- a/report/test/generator/report-generator-test.js +++ b/report/test/generator/report-generator-test.js @@ -108,8 +108,8 @@ describe('ReportGenerator', () => { category,score \\"performance\\",\\"0.28\\" \\"accessibility\\",\\"0.78\\" -\\"best-practices\\",\\"0.35\\" -\\"seo\\",\\"0.7\\" +\\"best-practices\\",\\"0.41\\" +\\"seo\\",\\"0.57\\" \\"pwa\\",\\"0.38\\" category,audit,score,displayValue,description From 6804b81ed82e65af9996588d78af7059171cda9b Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Mon, 8 Apr 2024 16:11:19 -0700 Subject: [PATCH 3/5] smoke reorg --- cli/test/fixtures/dobetterweb/dbw_tester.html | 20 ++++ cli/test/fixtures/font-size-styles.css | 7 ++ cli/test/fixtures/font-size.html | 38 ++++++ cli/test/fixtures/seo/seo-failure-cases.html | 13 --- cli/test/fixtures/seo/seo-tester.html | 15 --- cli/test/smokehouse/core-tests.js | 2 + .../test-definitions/dobetterweb.js | 15 ++- .../smokehouse/test-definitions/font-size.js | 108 ++++++++++++++++++ .../test-definitions/seo-failing.js | 21 ---- .../test-definitions/seo-passing.js | 90 --------------- .../test-definitions/seo-status-403.js | 9 -- 11 files changed, 187 insertions(+), 151 deletions(-) create mode 100644 cli/test/fixtures/font-size-styles.css create mode 100644 cli/test/fixtures/font-size.html create mode 100644 cli/test/smokehouse/test-definitions/font-size.js diff --git a/cli/test/fixtures/dobetterweb/dbw_tester.html b/cli/test/fixtures/dobetterweb/dbw_tester.html index 58d2765a5bb8..b5d0e960a199 100644 --- a/cli/test/fixtures/dobetterweb/dbw_tester.html +++ b/cli/test/fixtures/dobetterweb/dbw_tester.html @@ -225,6 +225,19 @@

Do better web tester page

+ + @@ -375,6 +388,9 @@

Do better web tester page

stampTemplate('paste-preventing-inputs', document.body); } +function linkTextTest() { + stampTemplate('link-text', document.body); +} function deprecationsTest() { // TODO: some deprecated API messages are not currently being logged correctly. @@ -437,6 +453,7 @@

Do better web tester page

isOnHttps(); noUnloadListenersTest(); thirdPartyCookieTest(); + linkTextTest(); } else { if (params.has('documentWrite')) { documentWriteTest(); @@ -477,6 +494,9 @@

Do better web tester page

if (params.has('3pcookie')) { thirdPartyCookieTest(); } + if (params.has('linktext')) { + linkTextTest(); + } } diff --git a/cli/test/fixtures/font-size-styles.css b/cli/test/fixtures/font-size-styles.css new file mode 100644 index 000000000000..4d8f6be3fb77 --- /dev/null +++ b/cli/test/fixtures/font-size-styles.css @@ -0,0 +1,7 @@ +/** some filler */ + +.small-4 { + font-size: 6px; +} + +/*# sourceURL=font-size-styles-magic.css */ diff --git a/cli/test/fixtures/font-size.html b/cli/test/fixtures/font-size.html new file mode 100644 index 000000000000..bec51c32bb6a --- /dev/null +++ b/cli/test/fixtures/font-size.html @@ -0,0 +1,38 @@ + + + + + + + + + + + +

Small text but still legible

+ + +

1....

+

2...

+

3..

+

4.

+
2
+ 34 +
+

5

+
+ + + diff --git a/cli/test/fixtures/seo/seo-failure-cases.html b/cli/test/fixtures/seo/seo-failure-cases.html index 5a2236cef565..60f5023277ba 100644 --- a/cli/test/fixtures/seo/seo-failure-cases.html +++ b/cli/test/fixtures/seo/seo-failure-cases.html @@ -9,8 +9,6 @@ - - @@ -28,17 +26,6 @@

SEO

-

Anchor text

- click this - click this - CLICK THIS - - - - click this - - - Some link diff --git a/cli/test/fixtures/seo/seo-tester.html b/cli/test/fixtures/seo/seo-tester.html index 444b9b8ae6bd..b7985670de43 100644 --- a/cli/test/fixtures/seo/seo-tester.html +++ b/cli/test/fixtures/seo/seo-tester.html @@ -49,21 +49,6 @@

Anchor text

click this click this -

Small text

- - -

1....

-

2...

-

3..

-

4.

-
2
- 34 -
-

5

-
- diff --git a/cli/test/smokehouse/core-tests.js b/cli/test/smokehouse/core-tests.js index 9d4ae94ebc26..898dbd02c10f 100644 --- a/cli/test/smokehouse/core-tests.js +++ b/cli/test/smokehouse/core-tests.js @@ -13,6 +13,7 @@ import dbw from './test-definitions/dobetterweb.js'; import errorsExpiredSsl from './test-definitions/errors-expired-ssl.js'; import errorsIframeExpiredSsl from './test-definitions/errors-iframe-expired-ssl.js'; import errorsInfiniteLoop from './test-definitions/errors-infinite-loop.js'; +import fontSize from './test-definitions/font-size.js'; import formsAutoComplete from './test-definitions/forms-autocomplete.js'; import fpsMax from './test-definitions/fps-max.js'; import fpsMaxPassive from './test-definitions/fps-max-passive.js'; @@ -77,6 +78,7 @@ const smokeTests = [ errorsExpiredSsl, errorsIframeExpiredSsl, errorsInfiniteLoop, + fontSize, formsAutoComplete, fpsMax, fpsMaxPassive, diff --git a/cli/test/smokehouse/test-definitions/dobetterweb.js b/cli/test/smokehouse/test-definitions/dobetterweb.js index 10cc01da3425..7adf07fce974 100644 --- a/cli/test/smokehouse/test-definitions/dobetterweb.js +++ b/cli/test/smokehouse/test-definitions/dobetterweb.js @@ -442,7 +442,7 @@ const expectations = { }, 'dom-size': { score: 1, - numericValue: 151, + numericValue: 160, details: { items: [ { @@ -450,7 +450,7 @@ const expectations = { value: { type: 'numeric', granularity: 1, - value: 151, + value: 160, }, }, { @@ -604,12 +604,21 @@ const expectations = { viewportContent: 'width=device-width, initial-scale=1, minimum-scale=1', }, }, + 'link-text': { + score: 0, + displayValue: '4 links found', + details: { + items: { + length: 4, + }, + }, + }, }, fullPageScreenshot: { screenshot: { width: 412, // Allow for differences in platforms. - height: '1350±100', + height: '1527±100', data: /^data:image\/webp;.{500,}/, }, nodes: { diff --git a/cli/test/smokehouse/test-definitions/font-size.js b/cli/test/smokehouse/test-definitions/font-size.js new file mode 100644 index 000000000000..f5e358fcce6d --- /dev/null +++ b/cli/test/smokehouse/test-definitions/font-size.js @@ -0,0 +1,108 @@ +/** + * @license + * Copyright 2024 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @type {Smokehouse.ExpectedRunnerResult} + * Expected Lighthouse audit values for a site that fails seo tests. + */ +const expectations = { + lhr: { + requestedUrl: 'http://localhost:10200/font-size.html', + finalDisplayedUrl: 'http://localhost:10200/font-size.html', + audits: { + 'font-size': { + score: 1, + details: { + items: [ + { + source: { + url: 'http://localhost:10200/font-size.html', + urlProvider: 'network', + line: 6, + column: 12, + }, + selector: '.small', + fontSize: '11px', + }, + { + source: { + url: 'http://localhost:10200/font-size.html', + urlProvider: 'network', + line: 10, + column: 55, + }, + selector: '.small-2', + fontSize: '11px', + }, + { + source: { + url: 'font-size-inline-magic.css', + urlProvider: 'comment', + line: 2, + column: 14, + }, + selector: '.small-3', + fontSize: '6px', + }, + { + source: { + url: 'font-size-styles-magic.css', + urlProvider: 'comment', + line: 2, + column: 10, + }, + selector: '.small-4', + fontSize: '6px', + }, + { + source: {type: 'code', value: 'User Agent Stylesheet'}, + selector: 'h6', + fontSize: '10.72px', + }, + { + source: {type: 'url', value: 'http://localhost:10200/font-size.html'}, + selector: { + type: 'node', + selector: 'body', + snippet: '', + }, + fontSize: '10px', + }, + { + source: {type: 'url', value: 'http://localhost:10200/font-size.html'}, + selector: { + type: 'node', + selector: 'font', + snippet: '', + }, + fontSize: '10px', + }, + { + source: {type: 'url', value: 'http://localhost:10200/font-size.html'}, + selector: { + type: 'node', + selector: 'div', + snippet: '

', + }, + fontSize: '10px', + }, + { + source: {type: 'code', value: 'Legible text'}, + selector: '', + fontSize: '≥ 12px', + }, + ], + }, + }, + }, + }, +}; + +export default { + id: 'font-size', + expectations, +}; + diff --git a/cli/test/smokehouse/test-definitions/seo-failing.js b/cli/test/smokehouse/test-definitions/seo-failing.js index 64d17ab0f421..07f51390d597 100644 --- a/cli/test/smokehouse/test-definitions/seo-failing.js +++ b/cli/test/smokehouse/test-definitions/seo-failing.js @@ -44,13 +44,6 @@ const expectations = { requestedUrl: BASE_URL + 'seo-failure-cases.html?' + failureHeaders, finalDisplayedUrl: BASE_URL + 'seo-failure-cases.html?' + failureHeaders, audits: { - 'viewport': { - score: 0, - details: { - type: 'debugdata', - viewportContent: 'invalid-content=should_have_looked_it_up', - }, - }, 'document-title': { score: 0, }, @@ -60,11 +53,6 @@ const expectations = { 'http-status-code': { score: 1, }, - 'font-size': { - score: 0, - explanation: - 'Text is illegible because there\'s no viewport meta tag optimized for mobile screens.', - }, 'crawlable-anchors': { score: 0, details: { @@ -73,15 +61,6 @@ const expectations = { }, }, }, - 'link-text': { - score: 0, - displayValue: '4 links found', - details: { - items: { - length: 4, - }, - }, - }, 'is-crawlable': { score: 0, details: { diff --git a/cli/test/smokehouse/test-definitions/seo-passing.js b/cli/test/smokehouse/test-definitions/seo-passing.js index 91769da47c9c..d7c1c23d6252 100644 --- a/cli/test/smokehouse/test-definitions/seo-passing.js +++ b/cli/test/smokehouse/test-definitions/seo-passing.js @@ -37,9 +37,6 @@ const expectations = { requestedUrl: BASE_URL + 'seo-tester.html?' + passHeaders, finalDisplayedUrl: BASE_URL + 'seo-tester.html?' + passHeaders, audits: { - 'viewport': { - score: 1, - }, 'document-title': { score: 1, }, @@ -49,90 +46,6 @@ const expectations = { 'http-status-code': { score: 1, }, - 'font-size': { - score: 1, - details: { - items: [ - { - source: { - url: /seo-tester\.html.+$/, - urlProvider: 'network', - line: 23, - column: 12, - }, - selector: '.small', - fontSize: '11px', - }, - { - source: { - url: /seo-tester\.html.+$/, - urlProvider: 'network', - line: 27, - column: 55, - }, - selector: '.small-2', - fontSize: '11px', - }, - { - source: { - url: /seo-tester-inline-magic\.css$/, - urlProvider: 'comment', - line: 2, - column: 14, - }, - selector: '.small-3', - fontSize: '6px', - }, - { - source: { - url: /seo-tester-styles-magic\.css$/, - urlProvider: 'comment', - line: 2, - column: 10, - }, - selector: '.small-4', - fontSize: '6px', - }, - { - source: {type: 'code', value: 'User Agent Stylesheet'}, - selector: 'h6', - fontSize: '10.72px', - }, - { - source: {type: 'url', value: /seo-tester\.html.+$/}, - selector: { - type: 'node', - selector: 'body', - snippet: '', - }, - fontSize: '10px', - }, - { - source: {type: 'url', value: /seo-tester\.html.+$/}, - selector: { - type: 'node', - selector: 'font', - snippet: '', - }, - fontSize: '10px', - }, - { - source: {type: 'url', value: /seo-tester\.html.+$/}, - selector: { - type: 'node', - selector: 'div', - snippet: '

', - }, - fontSize: '10px', - }, - { - source: {type: 'code', value: 'Legible text'}, - selector: '', - fontSize: '≥ 12px', - }, - ], - }, - }, 'crawlable-anchors': { score: 0, details: { @@ -141,9 +54,6 @@ const expectations = { }, }, }, - 'link-text': { - score: 1, - }, 'is-crawlable': { score: 1, }, diff --git a/cli/test/smokehouse/test-definitions/seo-status-403.js b/cli/test/smokehouse/test-definitions/seo-status-403.js index ef18ee2ae13f..d51725e9dec0 100644 --- a/cli/test/smokehouse/test-definitions/seo-status-403.js +++ b/cli/test/smokehouse/test-definitions/seo-status-403.js @@ -33,24 +33,15 @@ const expectations = { 'http-status-code': { score: null, }, - 'viewport': { - score: null, - }, 'document-title': { score: null, }, 'meta-description': { score: null, }, - 'font-size': { - score: null, - }, 'crawlable-anchors': { score: null, }, - 'link-text': { - score: null, - }, 'is-crawlable': { score: null, }, From b1242173ceb343dbabc66162d6c2680a5c8d5edd Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Mon, 8 Apr 2024 18:10:20 -0700 Subject: [PATCH 4/5] smoke cleanup --- cli/test/fixtures/seo/seo-tester-styles.css | 7 ------- cli/test/fixtures/seo/seo-tester.html | 15 --------------- .../smokehouse/test-definitions/fps-scaled.js | 16 +++++++++++++++- 3 files changed, 15 insertions(+), 23 deletions(-) delete mode 100644 cli/test/fixtures/seo/seo-tester-styles.css diff --git a/cli/test/fixtures/seo/seo-tester-styles.css b/cli/test/fixtures/seo/seo-tester-styles.css deleted file mode 100644 index af269713f437..000000000000 --- a/cli/test/fixtures/seo/seo-tester-styles.css +++ /dev/null @@ -1,7 +0,0 @@ -/** some filler */ - -.small-4 { - font-size: 6px; -} - -/*# sourceURL=seo-tester-styles-magic.css */ diff --git a/cli/test/fixtures/seo/seo-tester.html b/cli/test/fixtures/seo/seo-tester.html index b7985670de43..b7dfdb3252c6 100644 --- a/cli/test/fixtures/seo/seo-tester.html +++ b/cli/test/fixtures/seo/seo-tester.html @@ -19,21 +19,6 @@ - - - - - diff --git a/cli/test/smokehouse/test-definitions/fps-scaled.js b/cli/test/smokehouse/test-definitions/fps-scaled.js index 24abcaa17522..391b68ec25ed 100644 --- a/cli/test/smokehouse/test-definitions/fps-scaled.js +++ b/cli/test/smokehouse/test-definitions/fps-scaled.js @@ -9,6 +9,7 @@ const config = { extends: 'lighthouse:default', settings: { onlyCategories: ['performance'], + onlyAudits: ['font-size'], }, }; @@ -28,7 +29,20 @@ const expectations = { lhr: { requestedUrl: 'http://localhost:10200/scaled-content.html', finalDisplayedUrl: 'http://localhost:10200/scaled-content.html', - audits: {}, + audits: { + 'viewport': { + score: 0, + details: { + type: 'debugdata', + viewportContent: 'initial-scale=0.5', + }, + }, + 'font-size': { + score: 0, + explanation: + 'Text is illegible because there\'s no viewport meta tag optimized for mobile screens.', + }, + }, fullPageScreenshot: { nodes: { _includes: [ From b8fef60647a261880d52ad390931e217febf7a72 Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Tue, 9 Apr 2024 10:52:03 -0700 Subject: [PATCH 5/5] backtrack link-text --- cli/test/fixtures/dobetterweb/dbw_tester.html | 20 ----------- cli/test/fixtures/seo/seo-failure-cases.html | 11 ++++++ .../test-definitions/dobetterweb.js | 15 ++------ .../test-definitions/seo-failing.js | 9 +++++ .../test-definitions/seo-passing.js | 3 ++ core/config/default-config.js | 2 +- .../reports/sample-flow-result.json | 36 +++++++++---------- core/test/results/sample_v2.json | 14 ++++---- .../test/generator/report-generator-test.js | 4 +-- 9 files changed, 54 insertions(+), 60 deletions(-) diff --git a/cli/test/fixtures/dobetterweb/dbw_tester.html b/cli/test/fixtures/dobetterweb/dbw_tester.html index b5d0e960a199..58d2765a5bb8 100644 --- a/cli/test/fixtures/dobetterweb/dbw_tester.html +++ b/cli/test/fixtures/dobetterweb/dbw_tester.html @@ -225,19 +225,6 @@

Do better web tester page

- - @@ -388,9 +375,6 @@

Anchor text

stampTemplate('paste-preventing-inputs', document.body); } -function linkTextTest() { - stampTemplate('link-text', document.body); -} function deprecationsTest() { // TODO: some deprecated API messages are not currently being logged correctly. @@ -453,7 +437,6 @@

Anchor text

isOnHttps(); noUnloadListenersTest(); thirdPartyCookieTest(); - linkTextTest(); } else { if (params.has('documentWrite')) { documentWriteTest(); @@ -494,9 +477,6 @@

Anchor text

if (params.has('3pcookie')) { thirdPartyCookieTest(); } - if (params.has('linktext')) { - linkTextTest(); - } } diff --git a/cli/test/fixtures/seo/seo-failure-cases.html b/cli/test/fixtures/seo/seo-failure-cases.html index 60f5023277ba..a4ca972c8c36 100644 --- a/cli/test/fixtures/seo/seo-failure-cases.html +++ b/cli/test/fixtures/seo/seo-failure-cases.html @@ -26,6 +26,17 @@

SEO

+

Anchor text

+ click this + click this + CLICK THIS + + + + click this + + + Some link diff --git a/cli/test/smokehouse/test-definitions/dobetterweb.js b/cli/test/smokehouse/test-definitions/dobetterweb.js index 7adf07fce974..10cc01da3425 100644 --- a/cli/test/smokehouse/test-definitions/dobetterweb.js +++ b/cli/test/smokehouse/test-definitions/dobetterweb.js @@ -442,7 +442,7 @@ const expectations = { }, 'dom-size': { score: 1, - numericValue: 160, + numericValue: 151, details: { items: [ { @@ -450,7 +450,7 @@ const expectations = { value: { type: 'numeric', granularity: 1, - value: 160, + value: 151, }, }, { @@ -604,21 +604,12 @@ const expectations = { viewportContent: 'width=device-width, initial-scale=1, minimum-scale=1', }, }, - 'link-text': { - score: 0, - displayValue: '4 links found', - details: { - items: { - length: 4, - }, - }, - }, }, fullPageScreenshot: { screenshot: { width: 412, // Allow for differences in platforms. - height: '1527±100', + height: '1350±100', data: /^data:image\/webp;.{500,}/, }, nodes: { diff --git a/cli/test/smokehouse/test-definitions/seo-failing.js b/cli/test/smokehouse/test-definitions/seo-failing.js index 07f51390d597..f0b45093584a 100644 --- a/cli/test/smokehouse/test-definitions/seo-failing.js +++ b/cli/test/smokehouse/test-definitions/seo-failing.js @@ -61,6 +61,15 @@ const expectations = { }, }, }, + 'link-text': { + score: 0, + displayValue: '4 links found', + details: { + items: { + length: 4, + }, + }, + }, 'is-crawlable': { score: 0, details: { diff --git a/cli/test/smokehouse/test-definitions/seo-passing.js b/cli/test/smokehouse/test-definitions/seo-passing.js index d7c1c23d6252..0b13ef87e547 100644 --- a/cli/test/smokehouse/test-definitions/seo-passing.js +++ b/cli/test/smokehouse/test-definitions/seo-passing.js @@ -54,6 +54,9 @@ const expectations = { }, }, }, + 'link-text': { + score: 1, + }, 'is-crawlable': { score: 1, }, diff --git a/core/config/default-config.js b/core/config/default-config.js index c404c7fcd80e..47211c941b4e 100644 --- a/core/config/default-config.js +++ b/core/config/default-config.js @@ -584,7 +584,6 @@ const defaultConfig = { {id: 'image-aspect-ratio', weight: 1, group: 'best-practices-ux'}, {id: 'image-size-responsive', weight: 1, group: 'best-practices-ux'}, {id: 'viewport', weight: 1, group: 'best-practices-ux'}, - {id: 'link-text', weight: 1, group: 'best-practices-ux'}, {id: 'font-size', weight: 1, group: 'best-practices-ux'}, // Browser Compatibility {id: 'doctype', weight: 1, group: 'best-practices-browser-compat'}, @@ -607,6 +606,7 @@ const defaultConfig = { {id: 'document-title', weight: 1, group: 'seo-content'}, {id: 'meta-description', weight: 1, group: 'seo-content'}, {id: 'http-status-code', weight: 1, group: 'seo-crawl'}, + {id: 'link-text', weight: 1, group: 'seo-content'}, {id: 'crawlable-anchors', weight: 1, group: 'seo-crawl'}, {id: 'is-crawlable', weight: 1, group: 'seo-crawl'}, {id: 'robots-txt', weight: 1, group: 'seo-crawl'}, diff --git a/core/test/fixtures/user-flows/reports/sample-flow-result.json b/core/test/fixtures/user-flows/reports/sample-flow-result.json index 10f62d7487ce..9c9d3c0397f9 100644 --- a/core/test/fixtures/user-flows/reports/sample-flow-result.json +++ b/core/test/fixtures/user-flows/reports/sample-flow-result.json @@ -4503,11 +4503,6 @@ "weight": 1, "group": "best-practices-ux" }, - { - "id": "link-text", - "weight": 1, - "group": "best-practices-ux" - }, { "id": "font-size", "weight": 1, @@ -4581,6 +4576,11 @@ "weight": 1, "group": "seo-crawl" }, + { + "id": "link-text", + "weight": 1, + "group": "seo-content" + }, { "id": "crawlable-anchors", "weight": 1, @@ -15347,11 +15347,6 @@ "weight": 1, "group": "best-practices-ux" }, - { - "id": "link-text", - "weight": 1, - "group": "best-practices-ux" - }, { "id": "font-size", "weight": 1, @@ -15369,7 +15364,7 @@ } ], "id": "best-practices", - "score": 0.89 + "score": 0.88 }, "seo": { "title": "SEO", @@ -15390,6 +15385,11 @@ "weight": 1, "group": "seo-content" }, + { + "id": "link-text", + "weight": 1, + "group": "seo-content" + }, { "id": "crawlable-anchors", "weight": 1, @@ -15411,7 +15411,7 @@ } ], "id": "seo", - "score": 0.75 + "score": 0.8 } }, "categoryGroups": { @@ -22171,11 +22171,6 @@ "weight": 1, "group": "best-practices-ux" }, - { - "id": "link-text", - "weight": 1, - "group": "best-practices-ux" - }, { "id": "font-size", "weight": 1, @@ -22249,6 +22244,11 @@ "weight": 1, "group": "seo-crawl" }, + { + "id": "link-text", + "weight": 1, + "group": "seo-content" + }, { "id": "crawlable-anchors", "weight": 1, @@ -22285,7 +22285,7 @@ } ], "id": "seo", - "score": 0.86 + "score": 0.88 }, "pwa": { "title": "PWA", diff --git a/core/test/results/sample_v2.json b/core/test/results/sample_v2.json index 912c4077a844..550dbc7149f8 100644 --- a/core/test/results/sample_v2.json +++ b/core/test/results/sample_v2.json @@ -6590,11 +6590,6 @@ "weight": 1, "group": "best-practices-ux" }, - { - "id": "link-text", - "weight": 1, - "group": "best-practices-ux" - }, { "id": "font-size", "weight": 1, @@ -6642,7 +6637,7 @@ } ], "id": "best-practices", - "score": 0.41 + "score": 0.39 }, "seo": { "title": "SEO", @@ -6668,6 +6663,11 @@ "weight": 1, "group": "seo-crawl" }, + { + "id": "link-text", + "weight": 1, + "group": "seo-content" + }, { "id": "crawlable-anchors", "weight": 1, @@ -6704,7 +6704,7 @@ } ], "id": "seo", - "score": 0.57 + "score": 0.63 }, "pwa": { "title": "PWA", diff --git a/report/test/generator/report-generator-test.js b/report/test/generator/report-generator-test.js index f412e77ebbaa..94e60b37a7a4 100644 --- a/report/test/generator/report-generator-test.js +++ b/report/test/generator/report-generator-test.js @@ -108,8 +108,8 @@ describe('ReportGenerator', () => { category,score \\"performance\\",\\"0.28\\" \\"accessibility\\",\\"0.78\\" -\\"best-practices\\",\\"0.41\\" -\\"seo\\",\\"0.57\\" +\\"best-practices\\",\\"0.39\\" +\\"seo\\",\\"0.63\\" \\"pwa\\",\\"0.38\\" category,audit,score,displayValue,description