From 073826226c3ffb2a5f6390ea0e905743d418bf83 Mon Sep 17 00:00:00 2001 From: Valery Yatsynovich Date: Mon, 13 May 2024 17:53:11 +0300 Subject: [PATCH] [plugin-lighthouse] Remove PWA category MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/GoogleChrome/lighthouse/releases/tag/v12.0.0: "As per Chrome’s updated Installability Criteria(https://developer.chrome.com/blog/update-install-criteria), Lighthouse has removed the PWA category (https://github.com/GoogleChrome/lighthouse/pull/15455). For future PWA testing, users will be directed to use the updated PWA documentation: https://developer.chrome.com/docs/devtools/progressive-web-apps/" --- docs/modules/plugins/pages/plugin-lighthouse.adoc | 6 ++---- .../main/java/org/vividus/lighthouse/LighthouseSteps.java | 7 +++---- .../main/resources/properties/defaults/default.properties | 2 +- .../java/org/vividus/lighthouse/LighthouseStepsTests.java | 3 +-- .../main/resources/story/integration/LighthouseSteps.story | 1 - 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/docs/modules/plugins/pages/plugin-lighthouse.adoc b/docs/modules/plugins/pages/plugin-lighthouse.adoc index ccb166e92f..1bd6d1ee90 100644 --- a/docs/modules/plugins/pages/plugin-lighthouse.adoc +++ b/docs/modules/plugins/pages/plugin-lighthouse.adoc @@ -25,8 +25,8 @@ include::partial$plugin-installation.adoc[] |The API key that identifies your project and provides you with API access, quota, and reports. Its recommended to specify the key if you plan to use the plugin in an automated way and make multiple queries per second. |`lighthouse.categories` -|comma-separated list of categories (`performance`, `pwa`, `best-practices`, `accessibility`, `seo`) -|`performance,pwa,best-practices,accessibility,seo` +|comma-separated list of categories (`performance`, `best-practices`, `accessibility`, `seo`) +|`performance,best-practices,accessibility,seo` |The audit categories to run, by default the scan includes all 5 categories, but you can select particular ones depending on which aspects of your website you wish to analyze. |`lighthouse.performance.percentile` @@ -70,7 +70,6 @@ include::partial$lighthouse-scan-type.adoc[] **** `Accessibility Score` **** `Best Practices Score` **** `Performance Score` -**** `PWA Score` **** `SEO Score` ** `$rule` - xref:parameters:comparison-rule.adoc[The comparison rule]. ** `$threshold` - The expected integer or floating (e.g. `0.35`) number. @@ -88,7 +87,6 @@ When I perform Lighthouse full scan of `https://dequeuniversity.com/demo/mars` p |Accessibility Score |GREATER_THAN|90 | |Best Practices Score |EQUAL_TO |100 | |Performance Score |GREATER_THAN|95 | -|PWA Score |GREATER_THAN|20 | |SEO Score |GREATER_THAN|85 | ---- diff --git a/vividus-plugin-lighthouse/src/main/java/org/vividus/lighthouse/LighthouseSteps.java b/vividus-plugin-lighthouse/src/main/java/org/vividus/lighthouse/LighthouseSteps.java index 0e1609153b..90ae188f05 100644 --- a/vividus-plugin-lighthouse/src/main/java/org/vividus/lighthouse/LighthouseSteps.java +++ b/vividus-plugin-lighthouse/src/main/java/org/vividus/lighthouse/LighthouseSteps.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2023 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,11 +62,10 @@ public final class LighthouseSteps { private static final Logger LOGGER = LoggerFactory.getLogger(LighthouseSteps.class); - private static final Map> CUSTOM_METRIC_FATORIES = Map.of( + private static final Map> CUSTOM_METRIC_FACTORIES = Map.of( "accessibilityScore", Categories::getAccessibility, "bestPracticesScore", Categories::getBestPractices, "performanceScore", Categories::getPerformance, - "pwaScore", Categories::getPwa, "seoScore", Categories::getSeo ); @@ -276,7 +275,7 @@ private Map getMetrics(LighthouseResultV5 result) } Categories scanCategories = result.getCategories(); - CUSTOM_METRIC_FATORIES.forEach((m, f) -> + CUSTOM_METRIC_FACTORIES.forEach((m, f) -> { LighthouseCategoryV5 categoryValue = f.apply(scanCategories); if (categoryValue != null) diff --git a/vividus-plugin-lighthouse/src/main/resources/properties/defaults/default.properties b/vividus-plugin-lighthouse/src/main/resources/properties/defaults/default.properties index ead27a84e2..e072f31aea 100644 --- a/vividus-plugin-lighthouse/src/main/resources/properties/defaults/default.properties +++ b/vividus-plugin-lighthouse/src/main/resources/properties/defaults/default.properties @@ -1,4 +1,4 @@ lighthouse.application-name= lighthouse.api-key= -lighthouse.categories=performance,pwa,best-practices,accessibility,seo +lighthouse.categories=performance,best-practices,accessibility,seo lighthouse.acceptable-score-percentage-delta=5 diff --git a/vividus-plugin-lighthouse/src/test/java/org/vividus/lighthouse/LighthouseStepsTests.java b/vividus-plugin-lighthouse/src/test/java/org/vividus/lighthouse/LighthouseStepsTests.java index 1cfa75da07..fc7c115e7b 100644 --- a/vividus-plugin-lighthouse/src/test/java/org/vividus/lighthouse/LighthouseStepsTests.java +++ b/vividus-plugin-lighthouse/src/test/java/org/vividus/lighthouse/LighthouseStepsTests.java @@ -109,8 +109,7 @@ class LighthouseStepsTests private static final BigDecimal SCORE_METRIC_VAL = new BigDecimal(0.99f); private static final String RESULT_AS_STRING = "{}"; private static final String SEO = "seo"; - private static final List CATEGORIES = List.of("performance", "pwa", "best-practices", "accessibility", - SEO); + private static final List CATEGORIES = List.of("performance", "best-practices", "accessibility", SEO); private static final String DESKTOP_STRATEGY = ScanType.DESKTOP.getStrategies()[0]; private static final String UNKNOWN_ERROR_MESSAGE = "Lighthouse returned error: Something went wrong."; private static final String PERFORMANCE_SCORE_LOG = "The performance score of the measurement #{} is {}"; diff --git a/vividus-tests/src/main/resources/story/integration/LighthouseSteps.story b/vividus-tests/src/main/resources/story/integration/LighthouseSteps.story index a8a03a2a76..f55dac7815 100644 --- a/vividus-tests/src/main/resources/story/integration/LighthouseSteps.story +++ b/vividus-tests/src/main/resources/story/integration/LighthouseSteps.story @@ -12,7 +12,6 @@ When I perform Lighthouse desktop scan of `${vividus-test-site-url}` page: |Accessibility Score |GREATER_THAN|85 | |Best Practices Score |GREATER_THAN|90 | |Performance Score |GREATER_THAN|90 | -|PWA Score |GREATER_THAN|20 | |SEO Score |GREATER_THAN|85 |