From 746dbbad0115a295dfcd0ebf684fb490670890ba Mon Sep 17 00:00:00 2001 From: Alessio Date: Mon, 16 Sep 2024 11:15:53 +0100 Subject: [PATCH 1/9] fixed data.urls replace --- lighthouse/lighthouse-get-urls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse/lighthouse-get-urls.js b/lighthouse/lighthouse-get-urls.js index bd6dfc0710..534c136c64 100644 --- a/lighthouse/lighthouse-get-urls.js +++ b/lighthouse/lighthouse-get-urls.js @@ -32,7 +32,7 @@ async function getURLs() { for (const folder of folders) { const files = await glob(`${directory.path}/${folder}/**/*.html`, { ignore: `${directory.path}/${folder}/index.html` }); for (const file of files) { - data.urls.push(file.replace('./build/', 'http://localhost:9000/')); + data.urls.push(file.replace('build/', 'http://localhost:9000/')); } } } From f3ba0aeaa04cca526d03a7ea844fbf1082b501f1 Mon Sep 17 00:00:00 2001 From: Alessio Date: Mon, 16 Sep 2024 16:14:00 +0100 Subject: [PATCH 2/9] updated script --- lighthouse/lighthouse.sh | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/lighthouse/lighthouse.sh b/lighthouse/lighthouse.sh index cb17c08fc3..1a0a8da562 100755 --- a/lighthouse/lighthouse.sh +++ b/lighthouse/lighthouse.sh @@ -1,14 +1,39 @@ #!/bin/bash +#!/bin/bash + +# Run the URL generation script node ./lighthouse/lighthouse-get-urls.js + +# Start the HTTP server in the background and capture its PID npx http-server -p 9000 ./build & +HTTP_SERVER_PID=$! + +# Install the necessary Lighthouse CI CLI globally npm install -g @lhci/cli@0.12.x -lhci healthcheck --fatal -for url in $(jq '.urls[]' ./lighthouse/urls.json); do sem + +# Perform a health check with Lighthouse CI +lhci healthcheck --fatal || { echo "Healthcheck failed"; exit 1; } + +# Collect data for each URL +for url in $(jq -r '.urls[]' ./lighthouse/urls.json); do lhci collect "--url=$url" --additive --config=./lighthouse/lighthouserc.js & done -sem --wait -lhci assert --config=./lighthouse/lighthouserc.js -lhci upload --config=./lighthouse/lighthouserc.js + +# Wait for all background lhci collect processes to finish +wait + +# Assert the collected data +lhci assert --config=./lighthouse/lighthouserc.js || { echo "Assertion failed"; exit 1; } + +# Upload the results +lhci upload --config=./lighthouse/lighthouserc.js || { echo "Upload failed"; exit 1; } + +# Capture the exit code of the last command EXIT_CODE=$? -kill $! + +# Kill the HTTP server +kill $HTTP_SERVER_PID + +# Exit with the captured exit code exit $EXIT_CODE + From 5ab22bf88fb06fe3125a0b8088e34b1af62a1cec Mon Sep 17 00:00:00 2001 From: Alessio Date: Mon, 16 Sep 2024 16:32:31 +0100 Subject: [PATCH 3/9] added sleep to wait for server --- lighthouse/lighthouse.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lighthouse/lighthouse.sh b/lighthouse/lighthouse.sh index 1a0a8da562..7559966f0c 100755 --- a/lighthouse/lighthouse.sh +++ b/lighthouse/lighthouse.sh @@ -5,9 +5,12 @@ node ./lighthouse/lighthouse-get-urls.js # Start the HTTP server in the background and capture its PID -npx http-server -p 9000 ./build & +npx http-server -p 9000 ./build > http-server.log 2>&1 & HTTP_SERVER_PID=$! +# Wait a bit to ensure the server is fully up +sleep 2 + # Install the necessary Lighthouse CI CLI globally npm install -g @lhci/cli@0.12.x From 3644a78ebb75eb5cfa9fb4d9fc94577190cc07ed Mon Sep 17 00:00:00 2001 From: Alessio Date: Mon, 16 Sep 2024 16:55:17 +0100 Subject: [PATCH 4/9] updated workflow --- .github/workflows/lighthouse-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lighthouse-ci.yml b/.github/workflows/lighthouse-ci.yml index 661548623f..2ddf37b321 100644 --- a/.github/workflows/lighthouse-ci.yml +++ b/.github/workflows/lighthouse-ci.yml @@ -21,6 +21,8 @@ jobs: - name: Build pages run: yarn build - name: Run Lighthouse CI - run: ./lighthouse/lighthouse.sh + run: | + npm install -g @lhci/cli@0.14.x + lhci autorun env: LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} From ca2b4f45d04e0906a8e3c7953c934fe2ba402913 Mon Sep 17 00:00:00 2001 From: Alessio Date: Mon, 16 Sep 2024 17:17:43 +0100 Subject: [PATCH 5/9] updated config path --- .github/workflows/lighthouse-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lighthouse-ci.yml b/.github/workflows/lighthouse-ci.yml index 2ddf37b321..edb6401248 100644 --- a/.github/workflows/lighthouse-ci.yml +++ b/.github/workflows/lighthouse-ci.yml @@ -23,6 +23,6 @@ jobs: - name: Run Lighthouse CI run: | npm install -g @lhci/cli@0.14.x - lhci autorun + lhci autorun --config=./lighthouse/lighthouserc.js env: LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} From d9ca2c8165fb1c1f4da527713742eff30b578c69 Mon Sep 17 00:00:00 2001 From: Alessio Date: Mon, 16 Sep 2024 17:35:26 +0100 Subject: [PATCH 6/9] added step in workflow --- .github/workflows/lighthouse-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lighthouse-ci.yml b/.github/workflows/lighthouse-ci.yml index edb6401248..0436b896e8 100644 --- a/.github/workflows/lighthouse-ci.yml +++ b/.github/workflows/lighthouse-ci.yml @@ -20,6 +20,8 @@ jobs: run: yarn install - name: Build pages run: yarn build + - name: Build urls + run: node ./lighthouse/lighthouse-get-urls.js - name: Run Lighthouse CI run: | npm install -g @lhci/cli@0.14.x From e5395eaa490386810b27a72bbbd5a95cb3717f75 Mon Sep 17 00:00:00 2001 From: Alessio Date: Mon, 16 Sep 2024 17:38:49 +0100 Subject: [PATCH 7/9] added ursl --- lighthouse/lighthouserc.js | 1 + lighthouse/urls.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 lighthouse/urls.json diff --git a/lighthouse/lighthouserc.js b/lighthouse/lighthouserc.js index 17da4d3b4c..b54c9cded3 100644 --- a/lighthouse/lighthouserc.js +++ b/lighthouse/lighthouserc.js @@ -1,6 +1,7 @@ module.exports = { ci: { collect: { + url: require('./lighthouse/urls.json').urls, numberOfRuns: 1, settings: { onlyCategories: ['accessibility'], diff --git a/lighthouse/urls.json b/lighthouse/urls.json new file mode 100644 index 0000000000..b06ce1a023 --- /dev/null +++ b/lighthouse/urls.json @@ -0,0 +1 @@ +{"urls":["http://localhost:9000/components/access-code/index.html","http://localhost:9000/components/access-code/example-access-code.html","http://localhost:9000/components/access-code/example-access-code-error.html","http://localhost:9000/components/accordion/index.html","http://localhost:9000/components/accordion/example-accordion.html","http://localhost:9000/components/accordion/example-accordion-open.html","http://localhost:9000/components/address-input/index.html","http://localhost:9000/components/address-input/example-address-input.html","http://localhost:9000/components/address-input/example-address-input-manual.html","http://localhost:9000/components/address-input/example-address-input-editable.html","http://localhost:9000/components/address-output/index.html","http://localhost:9000/components/address-output/example-address-output.html","http://localhost:9000/components/autosuggest/index.html","http://localhost:9000/components/autosuggest/example-autosuggest-country.html","http://localhost:9000/components/autosuggest/example-autosuggest-country-multiple.html","http://localhost:9000/components/back-to-top/index.html","http://localhost:9000/components/back-to-top/example-full-page-back-to-top.html","http://localhost:9000/components/back-to-top/example-back-to-top.html","http://localhost:9000/components/breadcrumbs/index.html","http://localhost:9000/components/breadcrumbs/example-breadcrumbs.html","http://localhost:9000/components/breadcrumbs/example-breadcrumbs-single.html","http://localhost:9000/components/browser-banner/index.html","http://localhost:9000/components/button/index.html","http://localhost:9000/components/button/example-button.html","http://localhost:9000/components/button/example-button-timer.html","http://localhost:9000/components/button/example-button-small.html","http://localhost:9000/components/button/example-button-secondary.html","http://localhost:9000/components/button/example-button-secondary-small.html","http://localhost:9000/components/button/example-button-print.html","http://localhost:9000/components/button/example-button-new-window.html","http://localhost:9000/components/button/example-button-loader.html","http://localhost:9000/components/button/example-button-link.html","http://localhost:9000/components/button/example-button-group.html","http://localhost:9000/components/button/example-button-ghost.html","http://localhost:9000/components/button/example-button-download.html","http://localhost:9000/components/button/example-button-disabled.html","http://localhost:9000/components/button/example-button-custom.html","http://localhost:9000/components/call-to-action/index.html","http://localhost:9000/components/call-to-action/example-call-to-action-default.html","http://localhost:9000/components/card/index.html","http://localhost:9000/components/card/example-card.html","http://localhost:9000/components/card/example-card-set.html","http://localhost:9000/components/card/example-card-set-with-lists.html","http://localhost:9000/components/card/example-card-set-with-images.html","http://localhost:9000/components/char-check-limit/index.html","http://localhost:9000/components/checkboxes/index.html","http://localhost:9000/components/checkboxes/example-checkboxes.html","http://localhost:9000/components/checkboxes/example-checkboxes-without-border.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-visible-text-input.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-select-all-button.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-text-input.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-select.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-select-expanded.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-radios.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-radios-expanded.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-checkboxes.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-hidden-label.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-descriptions.html","http://localhost:9000/components/checkboxes/example-checkboxes-error.html","http://localhost:9000/components/checkboxes/example-checkboxes-disabled.html","http://localhost:9000/components/content-pagination/index.html","http://localhost:9000/components/content-pagination/example-content-pagination.html","http://localhost:9000/components/cookies-banner/index.html","http://localhost:9000/components/cookies-banner/example-cookies-banner.html","http://localhost:9000/components/cookies-banner/example-cookies-banner-cymraeg.html","http://localhost:9000/components/date-input/index.html","http://localhost:9000/components/date-input/example-date-input.html","http://localhost:9000/components/date-input/example-date-input-single-field.html","http://localhost:9000/components/date-input/example-date-input-error.html","http://localhost:9000/components/date-input/example-date-input-error-for-single-field.html","http://localhost:9000/components/date-input/example-date-input-double-field.html","http://localhost:9000/components/description-list/index.html","http://localhost:9000/components/description-list/example-description-list.html","http://localhost:9000/components/details/index.html","http://localhost:9000/components/details/example-details.html","http://localhost:9000/components/details/example-details-with-warning.html","http://localhost:9000/components/details/example-details-with-saved-state.html","http://localhost:9000/components/document-list/index.html","http://localhost:9000/components/document-list/example-document-list-search-results.html","http://localhost:9000/components/document-list/example-document-list-search-result-featured.html","http://localhost:9000/components/document-list/example-document-list-downloads.html","http://localhost:9000/components/document-list/example-document-list-articles.html","http://localhost:9000/components/document-list/example-document-list-article-featured.html","http://localhost:9000/components/download-resources/index.html","http://localhost:9000/components/duration/index.html","http://localhost:9000/components/duration/example-duration.html","http://localhost:9000/components/duration/example-duration-single-field.html","http://localhost:9000/components/duration/example-duration-error.html","http://localhost:9000/components/duration/example-duration-error-for-single-field.html","http://localhost:9000/components/error/index.html","http://localhost:9000/components/external-link/index.html","http://localhost:9000/components/external-link/example-external-link.html","http://localhost:9000/components/feedback/index.html","http://localhost:9000/components/feedback/example-feedback-call-to-action.html","http://localhost:9000/components/field/index.html","http://localhost:9000/components/fieldset/index.html","http://localhost:9000/components/footer/index.html","http://localhost:9000/components/footer/example-footer.html","http://localhost:9000/components/footer/example-footer-with-copyright.html","http://localhost:9000/components/footer/example-footer-with-coat-of-arms.html","http://localhost:9000/components/footer/example-footer-with-alternative-organisation.html","http://localhost:9000/components/footer/example-footer-warning.html","http://localhost:9000/components/footer/example-footer-transactional.html","http://localhost:9000/components/footer/example-footer-default.html","http://localhost:9000/components/footer/example-footer-cymraeg.html","http://localhost:9000/components/header/index.html","http://localhost:9000/components/header/example-header-neutral.html","http://localhost:9000/components/header/example-header-multiple-logos.html","http://localhost:9000/components/header/example-header-internal.html","http://localhost:9000/components/header/example-header-external-with-sub-navigation.html","http://localhost:9000/components/header/example-header-external-with-sub-navigation-removed.html","http://localhost:9000/components/header/example-header-external-with-service-links.html","http://localhost:9000/components/header/example-header-external-with-navigation.html","http://localhost:9000/components/header/example-header-external-with-navigation-and-search.html","http://localhost:9000/components/header/example-header-external-welsh.html","http://localhost:9000/components/header/example-header-external-for-surveys.html","http://localhost:9000/components/header/example-header-external-for-survey-with-description.html","http://localhost:9000/components/header/example-header-default.html","http://localhost:9000/components/hero/index.html","http://localhost:9000/components/hero/example-hero-default.html","http://localhost:9000/components/hero/example-hero-dark.html","http://localhost:9000/components/icon/index.html","http://localhost:9000/components/image/index.html","http://localhost:9000/components/image/example-image-for-retina-screens.html","http://localhost:9000/components/image/example-image-for-regular-screens.html","http://localhost:9000/components/input/index.html","http://localhost:9000/components/input/example-input-text.html","http://localhost:9000/components/input/example-input-text-with-description.html","http://localhost:9000/components/input/example-input-text-with-character-limit-checker.html","http://localhost:9000/components/input/example-input-text-width-constrained.html","http://localhost:9000/components/input/example-input-telephone.html","http://localhost:9000/components/input/example-input-search.html","http://localhost:9000/components/input/example-input-search-with-placeholder.html","http://localhost:9000/components/input/example-input-search-with-character-check.html","http://localhost:9000/components/input/example-input-numeric-values.html","http://localhost:9000/components/input/example-input-number.html","http://localhost:9000/components/input/example-input-number-suffixed.html","http://localhost:9000/components/input/example-input-number-prefixed.html","http://localhost:9000/components/input/example-input-email.html","http://localhost:9000/components/label/index.html","http://localhost:9000/components/label/example-label.html","http://localhost:9000/components/label/example-label-with-description.html","http://localhost:9000/components/language-selector/index.html","http://localhost:9000/components/list/index.html","http://localhost:9000/components/list/example-summary-list.html","http://localhost:9000/components/list/example-suffixed-list.html","http://localhost:9000/components/list/example-prefixed-list.html","http://localhost:9000/components/list/example-numbered-list.html","http://localhost:9000/components/list/example-nested-list.html","http://localhost:9000/components/list/example-list-with-icon-suffix.html","http://localhost:9000/components/list/example-list-with-icon-prefix.html","http://localhost:9000/components/list/example-inline-list.html","http://localhost:9000/components/list/example-inline-list-with-social-icon-prefix.html","http://localhost:9000/components/list/example-dashed-list.html","http://localhost:9000/components/list/example-bulleted-list.html","http://localhost:9000/components/list/example-bare-list.html","http://localhost:9000/components/message/index.html","http://localhost:9000/components/message-list/index.html","http://localhost:9000/components/metadata/index.html","http://localhost:9000/components/modal/index.html","http://localhost:9000/components/multiple-input-fields/index.html","http://localhost:9000/components/mutually-exclusive/index.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-textarea.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-number.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-multiple-options.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-email.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-duration.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-date.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-date-with-error.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-checkboxes.html","http://localhost:9000/components/navigation/index.html","http://localhost:9000/components/pagination/index.html","http://localhost:9000/components/pagination/example-pagination.html","http://localhost:9000/components/pagination/example-pagination-with-no-range-indicator.html","http://localhost:9000/components/pagination/example-pagination-last.html","http://localhost:9000/components/pagination/example-pagination-first.html","http://localhost:9000/components/panel/index.html","http://localhost:9000/components/panel/example-panel-with-warning.html","http://localhost:9000/components/panel/example-panel-with-success-message.html","http://localhost:9000/components/panel/example-panel-with-spacious-information.html","http://localhost:9000/components/panel/example-panel-with-information.html","http://localhost:9000/components/panel/example-panel-with-error-summary.html","http://localhost:9000/components/panel/example-panel-with-error-details.html","http://localhost:9000/components/panel/example-panel-with-announcement.html","http://localhost:9000/components/panel/example-panel-bare.html","http://localhost:9000/components/password/index.html","http://localhost:9000/components/password/example-password.html","http://localhost:9000/components/phase-banner/index.html","http://localhost:9000/components/phase-banner/example-phase-banner-beta.html","http://localhost:9000/components/phase-banner/example-phase-banner-alpha.html","http://localhost:9000/components/question/index.html","http://localhost:9000/components/question/example-question-no-fieldset.html","http://localhost:9000/components/question/example-question-interviewer-note.html","http://localhost:9000/components/question/example-question-fieldset.html","http://localhost:9000/components/question/example-question-ccs.html","http://localhost:9000/components/quote/index.html","http://localhost:9000/components/quote/example-quote.html","http://localhost:9000/components/radios/index.html","http://localhost:9000/components/radios/example-radios.html","http://localhost:9000/components/radios/example-radios-without-border.html","http://localhost:9000/components/radios/example-radios-with-visible-text-input.html","http://localhost:9000/components/radios/example-radios-with-separator.html","http://localhost:9000/components/radios/example-radios-with-revealed-text-input.html","http://localhost:9000/components/radios/example-radios-with-revealed-text-input-expanded.html","http://localhost:9000/components/radios/example-radios-with-revealed-text-area.html","http://localhost:9000/components/radios/example-radios-with-revealed-text-area-expanded.html","http://localhost:9000/components/radios/example-radios-with-revealed-select.html","http://localhost:9000/components/radios/example-radios-with-revealed-select-expanded.html","http://localhost:9000/components/radios/example-radios-with-revealed-radios.html","http://localhost:9000/components/radios/example-radios-with-revealed-radios-expanded.html","http://localhost:9000/components/radios/example-radios-with-revealed-checkboxes.html","http://localhost:9000/components/radios/example-radios-with-revealed-checkboxes-expanded.html","http://localhost:9000/components/radios/example-radios-with-error.html","http://localhost:9000/components/radios/example-radios-with-descriptions.html","http://localhost:9000/components/radios/example-radios-with-clear-button.html","http://localhost:9000/components/radios/example-radios-with-clear-button-expanded.html","http://localhost:9000/components/related-content/index.html","http://localhost:9000/components/related-content/example-related-content-social-media.html","http://localhost:9000/components/related-content/example-related-content-multiple-rows-of-links.html","http://localhost:9000/components/related-content/example-related-content-general.html","http://localhost:9000/components/relationships/index.html","http://localhost:9000/components/relationships/example-relationships.html","http://localhost:9000/components/relationships/example-relationships-you.html","http://localhost:9000/components/relationships/example-relationships-error.html","http://localhost:9000/components/reply/index.html","http://localhost:9000/components/section-navigation/index.html","http://localhost:9000/components/section-navigation/example-section-navigation.html","http://localhost:9000/components/section-navigation/example-section-navigation-vertical.html","http://localhost:9000/components/section-navigation/example-section-navigation-single-vertical-with-title.html","http://localhost:9000/components/select/index.html","http://localhost:9000/components/select/example-select.html","http://localhost:9000/components/select/example-select-with-inline-label.html","http://localhost:9000/components/select/example-select-with-error.html","http://localhost:9000/components/select/example-select-wide.html","http://localhost:9000/components/share-page/index.html","http://localhost:9000/components/share-page/example-share-page.html","http://localhost:9000/components/skip-to-content/index.html","http://localhost:9000/components/skip-to-content/example-skip-to-content.html","http://localhost:9000/components/status/index.html","http://localhost:9000/components/status/example-status-success.html","http://localhost:9000/components/status/example-status-small.html","http://localhost:9000/components/status/example-status-pending.html","http://localhost:9000/components/status/example-status-neutral-information.html","http://localhost:9000/components/status/example-status-error.html","http://localhost:9000/components/status/example-status-dead.html","http://localhost:9000/components/summary/index.html","http://localhost:9000/components/summary/example-summary.html","http://localhost:9000/components/summary/example-summary-no-action.html","http://localhost:9000/components/summary/example-summary-multiple.html","http://localhost:9000/components/summary/example-summary-hub.html","http://localhost:9000/components/summary/example-summary-hub-minimal.html","http://localhost:9000/components/summary/example-summary-household.html","http://localhost:9000/components/summary/example-summary-household-no-rows.html","http://localhost:9000/components/summary/example-summary-grouped.html","http://localhost:9000/components/summary/example-summary-grouped-with-errors.html","http://localhost:9000/components/summary/example-summary-grouped-total.html","http://localhost:9000/components/summary/example-summary-card-grouped.html","http://localhost:9000/components/table/index.html","http://localhost:9000/components/table/example-table-sortable.html","http://localhost:9000/components/table/example-table-scrollable.html","http://localhost:9000/components/table/example-table-responsive.html","http://localhost:9000/components/table/example-table-numeric.html","http://localhost:9000/components/table/example-table-footer.html","http://localhost:9000/components/table/example-table-compact.html","http://localhost:9000/components/table/example-table-basic.html","http://localhost:9000/components/table-of-contents/index.html","http://localhost:9000/components/table-of-contents/example-table-of-contents-sticky.html","http://localhost:9000/components/table-of-contents/example-table-of-contents-sticky-full-page.html","http://localhost:9000/components/table-of-contents/example-table-of-contents-single.html","http://localhost:9000/components/table-of-contents/example-table-of-contents-grouped.html","http://localhost:9000/components/tabs/index.html","http://localhost:9000/components/tabs/example-tabs.html","http://localhost:9000/components/tabs/example-tabs-details.html","http://localhost:9000/components/text-indent/index.html","http://localhost:9000/components/text-indent/example-text-indent.html","http://localhost:9000/components/textarea/index.html","http://localhost:9000/components/textarea/example-textarea.html","http://localhost:9000/components/textarea/example-textarea-with-character-limit.html","http://localhost:9000/components/textarea/example-textarea-error.html","http://localhost:9000/components/timeline/index.html","http://localhost:9000/components/timeline/example-timeline.html","http://localhost:9000/components/timeout-modal/index.html","http://localhost:9000/components/timeout-modal/example-timeout-modal.html","http://localhost:9000/components/timeout-panel/index.html","http://localhost:9000/components/timeout-panel/example-panel-with-timeout-warning.html","http://localhost:9000/components/upload/index.html","http://localhost:9000/components/upload/example-upload.html","http://localhost:9000/components/upload/example-upload-error.html","http://localhost:9000/components/video/index.html","http://localhost:9000/components/video/example-video.html","http://localhost:9000/patterns/addresses/index.html","http://localhost:9000/patterns/addresses/example-address-input.html","http://localhost:9000/patterns/addresses/example-address-input-non-editable.html","http://localhost:9000/patterns/addresses/example-address-input-non-editable-register-address.html","http://localhost:9000/patterns/addresses/example-address-input-non-editable-confirm-address.html","http://localhost:9000/patterns/addresses/example-address-input-manual.html","http://localhost:9000/patterns/addresses/example-address-input-manual-error.html","http://localhost:9000/patterns/change-language/index.html","http://localhost:9000/patterns/change-language/example-change-language-english.html","http://localhost:9000/patterns/change-language/example-change-language-cymraeg.html","http://localhost:9000/patterns/confirmation-page/index.html","http://localhost:9000/patterns/confirmation-page/example-confirmation-page.html","http://localhost:9000/patterns/cookies-settings/index.html","http://localhost:9000/patterns/cookies-settings/example-cookie-settings-page.html","http://localhost:9000/patterns/correct-errors/index.html","http://localhost:9000/patterns/correct-errors/example-errors-proto.html","http://localhost:9000/patterns/correct-errors/example-errors-proto-errors.html","http://localhost:9000/patterns/correct-errors/example-error-summary.html","http://localhost:9000/patterns/correct-errors/example-error-details.html","http://localhost:9000/patterns/download-resources/index.html","http://localhost:9000/patterns/download-resources/example-download-resources.html","http://localhost:9000/patterns/error-status-pages/index.html","http://localhost:9000/patterns/error-status-pages/example-timed-out-error.html","http://localhost:9000/patterns/error-status-pages/example-timed-out-error-not-signed-in.html","http://localhost:9000/patterns/error-status-pages/example-server-error.html","http://localhost:9000/patterns/error-status-pages/example-page-not-found-error.html","http://localhost:9000/patterns/error-status-pages/example-page-not-found-error-with-code.html","http://localhost:9000/patterns/error-status-pages/example-maintenance-notice.html","http://localhost:9000/patterns/error-status-pages/example-browser-incompatible-error.html","http://localhost:9000/patterns/error-status-pages/example-access-denied-error.html","http://localhost:9000/patterns/extend-session/index.html","http://localhost:9000/patterns/extend-session/example-timeout.html","http://localhost:9000/patterns/feedback/index.html","http://localhost:9000/patterns/feedback/example-feedback-success.html","http://localhost:9000/patterns/feedback/example-feedback-form.html","http://localhost:9000/patterns/feedback/example-feedback-form-errors.html","http://localhost:9000/patterns/guide/index.html","http://localhost:9000/patterns/guide/example-guide.html","http://localhost:9000/patterns/guide/example-guide-rtl.html","http://localhost:9000/patterns/guide/example-guide-overview.html","http://localhost:9000/patterns/hub-and-spoke/index.html","http://localhost:9000/patterns/hub-and-spoke/example-spoke-summary.html","http://localhost:9000/patterns/hub-and-spoke/example-spoke-start.html","http://localhost:9000/patterns/hub-and-spoke/example-spoke-continue.html","http://localhost:9000/patterns/hub-and-spoke/example-hub.html","http://localhost:9000/patterns/hub-and-spoke/example-hub-complete.html","http://localhost:9000/patterns/input-email-with-error/index.html","http://localhost:9000/patterns/input-email-with-error/example-input-email-with-error.html","http://localhost:9000/patterns/names/index.html","http://localhost:9000/patterns/names/example-name-single-input-field.html","http://localhost:9000/patterns/names/example-name-multiple-input-field.html","http://localhost:9000/patterns/news/index.html","http://localhost:9000/patterns/news/example-tag.html","http://localhost:9000/patterns/news/example-landing.html","http://localhost:9000/patterns/news/example-category.html","http://localhost:9000/patterns/news/example-article.html","http://localhost:9000/patterns/numeric-values/index.html","http://localhost:9000/patterns/numeric-values/example-input-number-suffixed-with-error.html","http://localhost:9000/patterns/phone-numbers/index.html","http://localhost:9000/patterns/phone-numbers/example-phone-number-error.html","http://localhost:9000/patterns/question/index.html","http://localhost:9000/patterns/question/example-question-anatomy.html","http://localhost:9000/patterns/save-and-sign-out/index.html","http://localhost:9000/patterns/save-and-sign-out/example-signed-out.html","http://localhost:9000/patterns/save-and-sign-out/example-save-and-sign-out-button.html","http://localhost:9000/patterns/send-a-web-form/index.html","http://localhost:9000/patterns/send-a-web-form/example-success.html","http://localhost:9000/patterns/send-a-web-form/example-form.html","http://localhost:9000/patterns/send-a-web-form/example-errors.html","http://localhost:9000/patterns/send-and-reply-to-messages/index.html","http://localhost:9000/patterns/send-and-reply-to-messages/example-message-list.html","http://localhost:9000/patterns/send-and-reply-to-messages/example-conversation.html","http://localhost:9000/patterns/survey-interstitial-page/index.html","http://localhost:9000/patterns/survey-interstitial-page/example-survey-interstitial-page.html","http://localhost:9000/patterns/survey-section-introduction-page/index.html","http://localhost:9000/patterns/survey-section-introduction-page/example-survey-section-introduction-page.html","http://localhost:9000/foundations/grid/index.html","http://localhost:9000/foundations/grid/example-grid-combo.html","http://localhost:9000/foundations/grid/example-grid-8.html","http://localhost:9000/foundations/grid/example-grid-7-4.html","http://localhost:9000/foundations/grid/example-grid-12.html","http://localhost:9000/foundations/headings/index.html","http://localhost:9000/foundations/headings/example-default-heading-sizes.html","http://localhost:9000/foundations/headings/example-breakpoint-headings.html","http://localhost:9000/foundations/highlighting/index.html","http://localhost:9000/foundations/highlighting/example-highlighting.html","http://localhost:9000/foundations/icons/index.html","http://localhost:9000/foundations/icons/example-icons-size.html","http://localhost:9000/foundations/links/index.html","http://localhost:9000/foundations/links/example-link.html","http://localhost:9000/foundations/page-template/index.html","http://localhost:9000/foundations/page-template/example-custom.html","http://localhost:9000/foundations/page-template/example-basic.html","http://localhost:9000/foundations/page-template/example-base-page-template-block-areas.html","http://localhost:9000/foundations/paragraphs/index.html","http://localhost:9000/foundations/paragraphs/example-paragraphs.html","http://localhost:9000/foundations/type-scale/index.html","http://localhost:9000/foundations/type-scale/example-type-scale.html"]} \ No newline at end of file From ea1ae27dfeac4940048557c3e2d6966784f25f44 Mon Sep 17 00:00:00 2001 From: Alessio Date: Tue, 17 Sep 2024 12:21:57 +0100 Subject: [PATCH 8/9] lighthouse tests fully updated --- .gitignore | 4 +++ lighthouse/lighthouse-get-urls.js | 7 +++--- lighthouse/lighthouse.sh | 42 ------------------------------- lighthouse/lighthouserc.js | 3 ++- lighthouse/urls.json | 1 - package.json | 1 + 6 files changed, 11 insertions(+), 47 deletions(-) delete mode 100755 lighthouse/lighthouse.sh delete mode 100644 lighthouse/urls.json diff --git a/.gitignore b/.gitignore index f267d1ba6a..a94eba5847 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,10 @@ backstop_data/bitmaps_test/ backstop_data/html_report/ backstop.config-for-docker.json +# Generated from lighthouse tests +.lighthouseci/ +lighthouse/urls.json + # npm package folders /components/ /page-templates/ diff --git a/lighthouse/lighthouse-get-urls.js b/lighthouse/lighthouse-get-urls.js index 534c136c64..aa68906ca7 100644 --- a/lighthouse/lighthouse-get-urls.js +++ b/lighthouse/lighthouse-get-urls.js @@ -30,9 +30,10 @@ async function getURLs() { for (const directory of directories) { const folders = await readdir(directory.path); for (const folder of folders) { - const files = await glob(`${directory.path}/${folder}/**/*.html`, { ignore: `${directory.path}/${folder}/index.html` }); - for (const file of files) { - data.urls.push(file.replace('build/', 'http://localhost:9000/')); + const files = await glob(`${directory.path}/${folder}/**/*.html`); + const filteredFiles = files.filter((path) => !path.includes('index.html') && !path.includes('example-skip-to-content.html')); + for (const file of filteredFiles) { + data.urls.push(file.replace('build/', 'http://localhost/')); } } } diff --git a/lighthouse/lighthouse.sh b/lighthouse/lighthouse.sh deleted file mode 100755 index 7559966f0c..0000000000 --- a/lighthouse/lighthouse.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -#!/bin/bash - -# Run the URL generation script -node ./lighthouse/lighthouse-get-urls.js - -# Start the HTTP server in the background and capture its PID -npx http-server -p 9000 ./build > http-server.log 2>&1 & -HTTP_SERVER_PID=$! - -# Wait a bit to ensure the server is fully up -sleep 2 - -# Install the necessary Lighthouse CI CLI globally -npm install -g @lhci/cli@0.12.x - -# Perform a health check with Lighthouse CI -lhci healthcheck --fatal || { echo "Healthcheck failed"; exit 1; } - -# Collect data for each URL -for url in $(jq -r '.urls[]' ./lighthouse/urls.json); do - lhci collect "--url=$url" --additive --config=./lighthouse/lighthouserc.js & -done - -# Wait for all background lhci collect processes to finish -wait - -# Assert the collected data -lhci assert --config=./lighthouse/lighthouserc.js || { echo "Assertion failed"; exit 1; } - -# Upload the results -lhci upload --config=./lighthouse/lighthouserc.js || { echo "Upload failed"; exit 1; } - -# Capture the exit code of the last command -EXIT_CODE=$? - -# Kill the HTTP server -kill $HTTP_SERVER_PID - -# Exit with the captured exit code -exit $EXIT_CODE - diff --git a/lighthouse/lighthouserc.js b/lighthouse/lighthouserc.js index b54c9cded3..42987617d4 100644 --- a/lighthouse/lighthouserc.js +++ b/lighthouse/lighthouserc.js @@ -1,7 +1,8 @@ module.exports = { ci: { collect: { - url: require('./lighthouse/urls.json').urls, + staticDistDir: './build', + url: require('./urls.json').urls, numberOfRuns: 1, settings: { onlyCategories: ['accessibility'], diff --git a/lighthouse/urls.json b/lighthouse/urls.json deleted file mode 100644 index b06ce1a023..0000000000 --- a/lighthouse/urls.json +++ /dev/null @@ -1 +0,0 @@ -{"urls":["http://localhost:9000/components/access-code/index.html","http://localhost:9000/components/access-code/example-access-code.html","http://localhost:9000/components/access-code/example-access-code-error.html","http://localhost:9000/components/accordion/index.html","http://localhost:9000/components/accordion/example-accordion.html","http://localhost:9000/components/accordion/example-accordion-open.html","http://localhost:9000/components/address-input/index.html","http://localhost:9000/components/address-input/example-address-input.html","http://localhost:9000/components/address-input/example-address-input-manual.html","http://localhost:9000/components/address-input/example-address-input-editable.html","http://localhost:9000/components/address-output/index.html","http://localhost:9000/components/address-output/example-address-output.html","http://localhost:9000/components/autosuggest/index.html","http://localhost:9000/components/autosuggest/example-autosuggest-country.html","http://localhost:9000/components/autosuggest/example-autosuggest-country-multiple.html","http://localhost:9000/components/back-to-top/index.html","http://localhost:9000/components/back-to-top/example-full-page-back-to-top.html","http://localhost:9000/components/back-to-top/example-back-to-top.html","http://localhost:9000/components/breadcrumbs/index.html","http://localhost:9000/components/breadcrumbs/example-breadcrumbs.html","http://localhost:9000/components/breadcrumbs/example-breadcrumbs-single.html","http://localhost:9000/components/browser-banner/index.html","http://localhost:9000/components/button/index.html","http://localhost:9000/components/button/example-button.html","http://localhost:9000/components/button/example-button-timer.html","http://localhost:9000/components/button/example-button-small.html","http://localhost:9000/components/button/example-button-secondary.html","http://localhost:9000/components/button/example-button-secondary-small.html","http://localhost:9000/components/button/example-button-print.html","http://localhost:9000/components/button/example-button-new-window.html","http://localhost:9000/components/button/example-button-loader.html","http://localhost:9000/components/button/example-button-link.html","http://localhost:9000/components/button/example-button-group.html","http://localhost:9000/components/button/example-button-ghost.html","http://localhost:9000/components/button/example-button-download.html","http://localhost:9000/components/button/example-button-disabled.html","http://localhost:9000/components/button/example-button-custom.html","http://localhost:9000/components/call-to-action/index.html","http://localhost:9000/components/call-to-action/example-call-to-action-default.html","http://localhost:9000/components/card/index.html","http://localhost:9000/components/card/example-card.html","http://localhost:9000/components/card/example-card-set.html","http://localhost:9000/components/card/example-card-set-with-lists.html","http://localhost:9000/components/card/example-card-set-with-images.html","http://localhost:9000/components/char-check-limit/index.html","http://localhost:9000/components/checkboxes/index.html","http://localhost:9000/components/checkboxes/example-checkboxes.html","http://localhost:9000/components/checkboxes/example-checkboxes-without-border.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-visible-text-input.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-select-all-button.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-text-input.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-select.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-select-expanded.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-radios.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-radios-expanded.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-checkboxes.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-hidden-label.html","http://localhost:9000/components/checkboxes/example-checkboxes-with-descriptions.html","http://localhost:9000/components/checkboxes/example-checkboxes-error.html","http://localhost:9000/components/checkboxes/example-checkboxes-disabled.html","http://localhost:9000/components/content-pagination/index.html","http://localhost:9000/components/content-pagination/example-content-pagination.html","http://localhost:9000/components/cookies-banner/index.html","http://localhost:9000/components/cookies-banner/example-cookies-banner.html","http://localhost:9000/components/cookies-banner/example-cookies-banner-cymraeg.html","http://localhost:9000/components/date-input/index.html","http://localhost:9000/components/date-input/example-date-input.html","http://localhost:9000/components/date-input/example-date-input-single-field.html","http://localhost:9000/components/date-input/example-date-input-error.html","http://localhost:9000/components/date-input/example-date-input-error-for-single-field.html","http://localhost:9000/components/date-input/example-date-input-double-field.html","http://localhost:9000/components/description-list/index.html","http://localhost:9000/components/description-list/example-description-list.html","http://localhost:9000/components/details/index.html","http://localhost:9000/components/details/example-details.html","http://localhost:9000/components/details/example-details-with-warning.html","http://localhost:9000/components/details/example-details-with-saved-state.html","http://localhost:9000/components/document-list/index.html","http://localhost:9000/components/document-list/example-document-list-search-results.html","http://localhost:9000/components/document-list/example-document-list-search-result-featured.html","http://localhost:9000/components/document-list/example-document-list-downloads.html","http://localhost:9000/components/document-list/example-document-list-articles.html","http://localhost:9000/components/document-list/example-document-list-article-featured.html","http://localhost:9000/components/download-resources/index.html","http://localhost:9000/components/duration/index.html","http://localhost:9000/components/duration/example-duration.html","http://localhost:9000/components/duration/example-duration-single-field.html","http://localhost:9000/components/duration/example-duration-error.html","http://localhost:9000/components/duration/example-duration-error-for-single-field.html","http://localhost:9000/components/error/index.html","http://localhost:9000/components/external-link/index.html","http://localhost:9000/components/external-link/example-external-link.html","http://localhost:9000/components/feedback/index.html","http://localhost:9000/components/feedback/example-feedback-call-to-action.html","http://localhost:9000/components/field/index.html","http://localhost:9000/components/fieldset/index.html","http://localhost:9000/components/footer/index.html","http://localhost:9000/components/footer/example-footer.html","http://localhost:9000/components/footer/example-footer-with-copyright.html","http://localhost:9000/components/footer/example-footer-with-coat-of-arms.html","http://localhost:9000/components/footer/example-footer-with-alternative-organisation.html","http://localhost:9000/components/footer/example-footer-warning.html","http://localhost:9000/components/footer/example-footer-transactional.html","http://localhost:9000/components/footer/example-footer-default.html","http://localhost:9000/components/footer/example-footer-cymraeg.html","http://localhost:9000/components/header/index.html","http://localhost:9000/components/header/example-header-neutral.html","http://localhost:9000/components/header/example-header-multiple-logos.html","http://localhost:9000/components/header/example-header-internal.html","http://localhost:9000/components/header/example-header-external-with-sub-navigation.html","http://localhost:9000/components/header/example-header-external-with-sub-navigation-removed.html","http://localhost:9000/components/header/example-header-external-with-service-links.html","http://localhost:9000/components/header/example-header-external-with-navigation.html","http://localhost:9000/components/header/example-header-external-with-navigation-and-search.html","http://localhost:9000/components/header/example-header-external-welsh.html","http://localhost:9000/components/header/example-header-external-for-surveys.html","http://localhost:9000/components/header/example-header-external-for-survey-with-description.html","http://localhost:9000/components/header/example-header-default.html","http://localhost:9000/components/hero/index.html","http://localhost:9000/components/hero/example-hero-default.html","http://localhost:9000/components/hero/example-hero-dark.html","http://localhost:9000/components/icon/index.html","http://localhost:9000/components/image/index.html","http://localhost:9000/components/image/example-image-for-retina-screens.html","http://localhost:9000/components/image/example-image-for-regular-screens.html","http://localhost:9000/components/input/index.html","http://localhost:9000/components/input/example-input-text.html","http://localhost:9000/components/input/example-input-text-with-description.html","http://localhost:9000/components/input/example-input-text-with-character-limit-checker.html","http://localhost:9000/components/input/example-input-text-width-constrained.html","http://localhost:9000/components/input/example-input-telephone.html","http://localhost:9000/components/input/example-input-search.html","http://localhost:9000/components/input/example-input-search-with-placeholder.html","http://localhost:9000/components/input/example-input-search-with-character-check.html","http://localhost:9000/components/input/example-input-numeric-values.html","http://localhost:9000/components/input/example-input-number.html","http://localhost:9000/components/input/example-input-number-suffixed.html","http://localhost:9000/components/input/example-input-number-prefixed.html","http://localhost:9000/components/input/example-input-email.html","http://localhost:9000/components/label/index.html","http://localhost:9000/components/label/example-label.html","http://localhost:9000/components/label/example-label-with-description.html","http://localhost:9000/components/language-selector/index.html","http://localhost:9000/components/list/index.html","http://localhost:9000/components/list/example-summary-list.html","http://localhost:9000/components/list/example-suffixed-list.html","http://localhost:9000/components/list/example-prefixed-list.html","http://localhost:9000/components/list/example-numbered-list.html","http://localhost:9000/components/list/example-nested-list.html","http://localhost:9000/components/list/example-list-with-icon-suffix.html","http://localhost:9000/components/list/example-list-with-icon-prefix.html","http://localhost:9000/components/list/example-inline-list.html","http://localhost:9000/components/list/example-inline-list-with-social-icon-prefix.html","http://localhost:9000/components/list/example-dashed-list.html","http://localhost:9000/components/list/example-bulleted-list.html","http://localhost:9000/components/list/example-bare-list.html","http://localhost:9000/components/message/index.html","http://localhost:9000/components/message-list/index.html","http://localhost:9000/components/metadata/index.html","http://localhost:9000/components/modal/index.html","http://localhost:9000/components/multiple-input-fields/index.html","http://localhost:9000/components/mutually-exclusive/index.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-textarea.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-number.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-multiple-options.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-email.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-duration.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-date.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-date-with-error.html","http://localhost:9000/components/mutually-exclusive/example-mutually-exclusive-checkboxes.html","http://localhost:9000/components/navigation/index.html","http://localhost:9000/components/pagination/index.html","http://localhost:9000/components/pagination/example-pagination.html","http://localhost:9000/components/pagination/example-pagination-with-no-range-indicator.html","http://localhost:9000/components/pagination/example-pagination-last.html","http://localhost:9000/components/pagination/example-pagination-first.html","http://localhost:9000/components/panel/index.html","http://localhost:9000/components/panel/example-panel-with-warning.html","http://localhost:9000/components/panel/example-panel-with-success-message.html","http://localhost:9000/components/panel/example-panel-with-spacious-information.html","http://localhost:9000/components/panel/example-panel-with-information.html","http://localhost:9000/components/panel/example-panel-with-error-summary.html","http://localhost:9000/components/panel/example-panel-with-error-details.html","http://localhost:9000/components/panel/example-panel-with-announcement.html","http://localhost:9000/components/panel/example-panel-bare.html","http://localhost:9000/components/password/index.html","http://localhost:9000/components/password/example-password.html","http://localhost:9000/components/phase-banner/index.html","http://localhost:9000/components/phase-banner/example-phase-banner-beta.html","http://localhost:9000/components/phase-banner/example-phase-banner-alpha.html","http://localhost:9000/components/question/index.html","http://localhost:9000/components/question/example-question-no-fieldset.html","http://localhost:9000/components/question/example-question-interviewer-note.html","http://localhost:9000/components/question/example-question-fieldset.html","http://localhost:9000/components/question/example-question-ccs.html","http://localhost:9000/components/quote/index.html","http://localhost:9000/components/quote/example-quote.html","http://localhost:9000/components/radios/index.html","http://localhost:9000/components/radios/example-radios.html","http://localhost:9000/components/radios/example-radios-without-border.html","http://localhost:9000/components/radios/example-radios-with-visible-text-input.html","http://localhost:9000/components/radios/example-radios-with-separator.html","http://localhost:9000/components/radios/example-radios-with-revealed-text-input.html","http://localhost:9000/components/radios/example-radios-with-revealed-text-input-expanded.html","http://localhost:9000/components/radios/example-radios-with-revealed-text-area.html","http://localhost:9000/components/radios/example-radios-with-revealed-text-area-expanded.html","http://localhost:9000/components/radios/example-radios-with-revealed-select.html","http://localhost:9000/components/radios/example-radios-with-revealed-select-expanded.html","http://localhost:9000/components/radios/example-radios-with-revealed-radios.html","http://localhost:9000/components/radios/example-radios-with-revealed-radios-expanded.html","http://localhost:9000/components/radios/example-radios-with-revealed-checkboxes.html","http://localhost:9000/components/radios/example-radios-with-revealed-checkboxes-expanded.html","http://localhost:9000/components/radios/example-radios-with-error.html","http://localhost:9000/components/radios/example-radios-with-descriptions.html","http://localhost:9000/components/radios/example-radios-with-clear-button.html","http://localhost:9000/components/radios/example-radios-with-clear-button-expanded.html","http://localhost:9000/components/related-content/index.html","http://localhost:9000/components/related-content/example-related-content-social-media.html","http://localhost:9000/components/related-content/example-related-content-multiple-rows-of-links.html","http://localhost:9000/components/related-content/example-related-content-general.html","http://localhost:9000/components/relationships/index.html","http://localhost:9000/components/relationships/example-relationships.html","http://localhost:9000/components/relationships/example-relationships-you.html","http://localhost:9000/components/relationships/example-relationships-error.html","http://localhost:9000/components/reply/index.html","http://localhost:9000/components/section-navigation/index.html","http://localhost:9000/components/section-navigation/example-section-navigation.html","http://localhost:9000/components/section-navigation/example-section-navigation-vertical.html","http://localhost:9000/components/section-navigation/example-section-navigation-single-vertical-with-title.html","http://localhost:9000/components/select/index.html","http://localhost:9000/components/select/example-select.html","http://localhost:9000/components/select/example-select-with-inline-label.html","http://localhost:9000/components/select/example-select-with-error.html","http://localhost:9000/components/select/example-select-wide.html","http://localhost:9000/components/share-page/index.html","http://localhost:9000/components/share-page/example-share-page.html","http://localhost:9000/components/skip-to-content/index.html","http://localhost:9000/components/skip-to-content/example-skip-to-content.html","http://localhost:9000/components/status/index.html","http://localhost:9000/components/status/example-status-success.html","http://localhost:9000/components/status/example-status-small.html","http://localhost:9000/components/status/example-status-pending.html","http://localhost:9000/components/status/example-status-neutral-information.html","http://localhost:9000/components/status/example-status-error.html","http://localhost:9000/components/status/example-status-dead.html","http://localhost:9000/components/summary/index.html","http://localhost:9000/components/summary/example-summary.html","http://localhost:9000/components/summary/example-summary-no-action.html","http://localhost:9000/components/summary/example-summary-multiple.html","http://localhost:9000/components/summary/example-summary-hub.html","http://localhost:9000/components/summary/example-summary-hub-minimal.html","http://localhost:9000/components/summary/example-summary-household.html","http://localhost:9000/components/summary/example-summary-household-no-rows.html","http://localhost:9000/components/summary/example-summary-grouped.html","http://localhost:9000/components/summary/example-summary-grouped-with-errors.html","http://localhost:9000/components/summary/example-summary-grouped-total.html","http://localhost:9000/components/summary/example-summary-card-grouped.html","http://localhost:9000/components/table/index.html","http://localhost:9000/components/table/example-table-sortable.html","http://localhost:9000/components/table/example-table-scrollable.html","http://localhost:9000/components/table/example-table-responsive.html","http://localhost:9000/components/table/example-table-numeric.html","http://localhost:9000/components/table/example-table-footer.html","http://localhost:9000/components/table/example-table-compact.html","http://localhost:9000/components/table/example-table-basic.html","http://localhost:9000/components/table-of-contents/index.html","http://localhost:9000/components/table-of-contents/example-table-of-contents-sticky.html","http://localhost:9000/components/table-of-contents/example-table-of-contents-sticky-full-page.html","http://localhost:9000/components/table-of-contents/example-table-of-contents-single.html","http://localhost:9000/components/table-of-contents/example-table-of-contents-grouped.html","http://localhost:9000/components/tabs/index.html","http://localhost:9000/components/tabs/example-tabs.html","http://localhost:9000/components/tabs/example-tabs-details.html","http://localhost:9000/components/text-indent/index.html","http://localhost:9000/components/text-indent/example-text-indent.html","http://localhost:9000/components/textarea/index.html","http://localhost:9000/components/textarea/example-textarea.html","http://localhost:9000/components/textarea/example-textarea-with-character-limit.html","http://localhost:9000/components/textarea/example-textarea-error.html","http://localhost:9000/components/timeline/index.html","http://localhost:9000/components/timeline/example-timeline.html","http://localhost:9000/components/timeout-modal/index.html","http://localhost:9000/components/timeout-modal/example-timeout-modal.html","http://localhost:9000/components/timeout-panel/index.html","http://localhost:9000/components/timeout-panel/example-panel-with-timeout-warning.html","http://localhost:9000/components/upload/index.html","http://localhost:9000/components/upload/example-upload.html","http://localhost:9000/components/upload/example-upload-error.html","http://localhost:9000/components/video/index.html","http://localhost:9000/components/video/example-video.html","http://localhost:9000/patterns/addresses/index.html","http://localhost:9000/patterns/addresses/example-address-input.html","http://localhost:9000/patterns/addresses/example-address-input-non-editable.html","http://localhost:9000/patterns/addresses/example-address-input-non-editable-register-address.html","http://localhost:9000/patterns/addresses/example-address-input-non-editable-confirm-address.html","http://localhost:9000/patterns/addresses/example-address-input-manual.html","http://localhost:9000/patterns/addresses/example-address-input-manual-error.html","http://localhost:9000/patterns/change-language/index.html","http://localhost:9000/patterns/change-language/example-change-language-english.html","http://localhost:9000/patterns/change-language/example-change-language-cymraeg.html","http://localhost:9000/patterns/confirmation-page/index.html","http://localhost:9000/patterns/confirmation-page/example-confirmation-page.html","http://localhost:9000/patterns/cookies-settings/index.html","http://localhost:9000/patterns/cookies-settings/example-cookie-settings-page.html","http://localhost:9000/patterns/correct-errors/index.html","http://localhost:9000/patterns/correct-errors/example-errors-proto.html","http://localhost:9000/patterns/correct-errors/example-errors-proto-errors.html","http://localhost:9000/patterns/correct-errors/example-error-summary.html","http://localhost:9000/patterns/correct-errors/example-error-details.html","http://localhost:9000/patterns/download-resources/index.html","http://localhost:9000/patterns/download-resources/example-download-resources.html","http://localhost:9000/patterns/error-status-pages/index.html","http://localhost:9000/patterns/error-status-pages/example-timed-out-error.html","http://localhost:9000/patterns/error-status-pages/example-timed-out-error-not-signed-in.html","http://localhost:9000/patterns/error-status-pages/example-server-error.html","http://localhost:9000/patterns/error-status-pages/example-page-not-found-error.html","http://localhost:9000/patterns/error-status-pages/example-page-not-found-error-with-code.html","http://localhost:9000/patterns/error-status-pages/example-maintenance-notice.html","http://localhost:9000/patterns/error-status-pages/example-browser-incompatible-error.html","http://localhost:9000/patterns/error-status-pages/example-access-denied-error.html","http://localhost:9000/patterns/extend-session/index.html","http://localhost:9000/patterns/extend-session/example-timeout.html","http://localhost:9000/patterns/feedback/index.html","http://localhost:9000/patterns/feedback/example-feedback-success.html","http://localhost:9000/patterns/feedback/example-feedback-form.html","http://localhost:9000/patterns/feedback/example-feedback-form-errors.html","http://localhost:9000/patterns/guide/index.html","http://localhost:9000/patterns/guide/example-guide.html","http://localhost:9000/patterns/guide/example-guide-rtl.html","http://localhost:9000/patterns/guide/example-guide-overview.html","http://localhost:9000/patterns/hub-and-spoke/index.html","http://localhost:9000/patterns/hub-and-spoke/example-spoke-summary.html","http://localhost:9000/patterns/hub-and-spoke/example-spoke-start.html","http://localhost:9000/patterns/hub-and-spoke/example-spoke-continue.html","http://localhost:9000/patterns/hub-and-spoke/example-hub.html","http://localhost:9000/patterns/hub-and-spoke/example-hub-complete.html","http://localhost:9000/patterns/input-email-with-error/index.html","http://localhost:9000/patterns/input-email-with-error/example-input-email-with-error.html","http://localhost:9000/patterns/names/index.html","http://localhost:9000/patterns/names/example-name-single-input-field.html","http://localhost:9000/patterns/names/example-name-multiple-input-field.html","http://localhost:9000/patterns/news/index.html","http://localhost:9000/patterns/news/example-tag.html","http://localhost:9000/patterns/news/example-landing.html","http://localhost:9000/patterns/news/example-category.html","http://localhost:9000/patterns/news/example-article.html","http://localhost:9000/patterns/numeric-values/index.html","http://localhost:9000/patterns/numeric-values/example-input-number-suffixed-with-error.html","http://localhost:9000/patterns/phone-numbers/index.html","http://localhost:9000/patterns/phone-numbers/example-phone-number-error.html","http://localhost:9000/patterns/question/index.html","http://localhost:9000/patterns/question/example-question-anatomy.html","http://localhost:9000/patterns/save-and-sign-out/index.html","http://localhost:9000/patterns/save-and-sign-out/example-signed-out.html","http://localhost:9000/patterns/save-and-sign-out/example-save-and-sign-out-button.html","http://localhost:9000/patterns/send-a-web-form/index.html","http://localhost:9000/patterns/send-a-web-form/example-success.html","http://localhost:9000/patterns/send-a-web-form/example-form.html","http://localhost:9000/patterns/send-a-web-form/example-errors.html","http://localhost:9000/patterns/send-and-reply-to-messages/index.html","http://localhost:9000/patterns/send-and-reply-to-messages/example-message-list.html","http://localhost:9000/patterns/send-and-reply-to-messages/example-conversation.html","http://localhost:9000/patterns/survey-interstitial-page/index.html","http://localhost:9000/patterns/survey-interstitial-page/example-survey-interstitial-page.html","http://localhost:9000/patterns/survey-section-introduction-page/index.html","http://localhost:9000/patterns/survey-section-introduction-page/example-survey-section-introduction-page.html","http://localhost:9000/foundations/grid/index.html","http://localhost:9000/foundations/grid/example-grid-combo.html","http://localhost:9000/foundations/grid/example-grid-8.html","http://localhost:9000/foundations/grid/example-grid-7-4.html","http://localhost:9000/foundations/grid/example-grid-12.html","http://localhost:9000/foundations/headings/index.html","http://localhost:9000/foundations/headings/example-default-heading-sizes.html","http://localhost:9000/foundations/headings/example-breakpoint-headings.html","http://localhost:9000/foundations/highlighting/index.html","http://localhost:9000/foundations/highlighting/example-highlighting.html","http://localhost:9000/foundations/icons/index.html","http://localhost:9000/foundations/icons/example-icons-size.html","http://localhost:9000/foundations/links/index.html","http://localhost:9000/foundations/links/example-link.html","http://localhost:9000/foundations/page-template/index.html","http://localhost:9000/foundations/page-template/example-custom.html","http://localhost:9000/foundations/page-template/example-basic.html","http://localhost:9000/foundations/page-template/example-base-page-template-block-areas.html","http://localhost:9000/foundations/paragraphs/index.html","http://localhost:9000/foundations/paragraphs/example-paragraphs.html","http://localhost:9000/foundations/type-scale/index.html","http://localhost:9000/foundations/type-scale/example-type-scale.html"]} \ No newline at end of file diff --git a/package.json b/package.json index ca466fed19..9b802a3a12 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "test:no-build": "TEST_PORT=3020 TEST_WITH_PUPPETEER=1 jest '.*\\.spec\\.js'", "test:with-log": "yarn test --no-color 2>test.log", "test:start-server": "TEST_PORT=3020 gulp start-dev-server", + "test-lighthouse": "yarn build && node ./lighthouse/lighthouse-get-urls.js && lhci autorun --config=./lighthouse/lighthouserc.js", "build": "yarn && yarn tidy-clean && NODE_ENV=production gulp build", "build-serve": "yarn build && gulp start-dev-server", "npm-bundle": "NODE_ENV=production yarn tidy-clean && NODE_ENV=production gulp build-package && babel-node ci/generate-npm-package.js", From 8746163cf97e909f85c65364c24b19c9301e423e Mon Sep 17 00:00:00 2001 From: Alessio Venturini <112873190+alessioventuriniAND@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:01:50 +0100 Subject: [PATCH 9/9] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 5be9bcc5ac..f2c6bd7d98 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,15 @@ yarn start Once the server has started, navigate to +## Lighthouse Testing - local + +This project uses [LHCI](https://www.npmjs.com/package/@lhci/cli). + +```bash +yarn global add @lhci/cli +yarn test-lighthouse +``` + ## Testing - macros and scripts This project uses [jest](https://jestjs.io/docs/cli) and supports its command line options.