Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugin-lighthouse] Remove PWA category #5042

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/modules/plugins/pages/plugin-lighthouse.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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.
Expand All @@ -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 |
----

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -62,11 +62,10 @@ public final class LighthouseSteps
{
private static final Logger LOGGER = LoggerFactory.getLogger(LighthouseSteps.class);

private static final Map<String, Function<Categories, LighthouseCategoryV5>> CUSTOM_METRIC_FATORIES = Map.of(
private static final Map<String, Function<Categories, LighthouseCategoryV5>> CUSTOM_METRIC_FACTORIES = Map.of(
"accessibilityScore", Categories::getAccessibility,
"bestPracticesScore", Categories::getBestPractices,
"performanceScore", Categories::getPerformance,
"pwaScore", Categories::getPwa,
"seoScore", Categories::getSeo
);

Expand Down Expand Up @@ -276,7 +275,7 @@ private Map<String, BigDecimal> 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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> CATEGORIES = List.of("performance", "pwa", "best-practices", "accessibility",
SEO);
private static final List<String> 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 {}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |


Expand Down
Loading