Accessibility Monitoring in Production With Lighthouse CI
AI generated
A11Y
WCAG
Accessibility · Tooling & Process
Accessibility Monitoring in Production With Lighthouse CI
Why an accessibility score needs continuous observation, not a once-a-year check

A WCAG audit produces a snapshot that can already be stale by the next deployment, because a new feature, a changed component markup, or an updated third-party script can shift the state of a page within minutes. Lighthouse CI closes exactly that gap by measuring the accessibility score automatically on every build, checking it against a defined threshold, and surfacing a regression immediately instead of only discovering it months later during the next manual review. This article covers setting up Lighthouse CI as continuous monitoring in a Magento and Hyvä deployment pipeline.

10 min read Lighthouse CI Monitoring Deployment Pipeline

1. Continuous monitoring instead of a one-off audit

A classic accessibility audit is usually commissioned once, or at long intervals, and produces a detailed, often manually written report that marks the state of a page on exactly one day. In practice, months routinely pass between two such audits, during which numerous new features, component redesigns, and third-party integrations go live, each one capable of reintroducing a previously fixed barrier without anyone noticing.

Monitoring takes a different approach. Instead of checking at a single point in time, the accessibility state gets measured automatically on every single deployment and plotted as a trend line over time, so a decline shows up right after the deployment that caused it, not at the next big audit months later. Lighthouse CI fits this well because it wires directly into existing deployment pipelines and needs no separate, manually triggered process.

2. Lighthouse CI versus Lighthouse in DevTools

The Lighthouse tool familiar from Chrome DevTools runs a single, manually triggered check in the browser and shows the result right in the developer interface, with each result standing alone and never automatically compared to a previous run. Lighthouse CI, by contrast, is a standalone command line tool that runs the same Lighthouse engine repeatedly and automatically, stores the results historically, and checks them against previously defined thresholds.

That historical record is the key difference. A single DevTools run only produces a snapshot, while Lighthouse CI turns repeated runs into a continuous time series that real trends and sudden outliers can be read from. Lighthouse CI also runs each check multiple times by default and uses the median, to smooth out measurement noise from system load or network conditions.

3. Integration into the deployment pipeline

In a GitLab CI pipeline for a Magento and Hyvä project, Lighthouse CI can be wired in as its own job after the build and before the actual deployment to a staging environment, with the job automatically failing as soon as the measured accessibility score drops below the defined threshold. That does not just surface a regression, it actively blocks it from ever reaching production.

It matters to run the job against an actually running instance populated with real data, such as a staging environment with a realistic product catalog, rather than against an empty development page, because many accessibility-relevant issues only surface with real content: long product names, populated shopping carts, or actual images.


# .gitlab-ci.yml
lighthouse-a11y:
  stage: test
  image: node:20
  script:
    - npm install -g @lhci/cli
    - lhci autorun --config=./lighthouserc.js
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
  allow_failure: false

4. Defining thresholds and budgets for the accessibility score

The lighthouserc.js configuration file defines through assertions what minimum accessibility score counts as passing, and a realistic starting value should be based on the page's actually measured current state instead of immediately forcing a theoretical ideal of a hundred points that a grown store can barely reach. A sensible approach is to set the threshold slightly below the current actual state at first and raise it step by step as concrete improvements land.

Beyond the global score, Lighthouse CI also lets individual audits get marked as mandatory criteria, such as sufficient color contrast or present form labels, so a team can deliberately decide which specific issues must never reach production, even while the overall score formally still clears the threshold.


// lighthouserc.js
module.exports = {
  ci: {
    collect: {
      url: ['https://staging.example.test/product/sample-item.html'],
      numberOfRuns: 3,
    },
    assert: {
      assertions: {
        'categories:accessibility': ['error', { minScore: 0.92 }],
        'color-contrast': ['error', { minScore: 1 }],
        'label': ['error', { minScore: 1 }],
      },
    },
    upload: { target: 'temporary-public-storage' },
  },
};

5. Regression detection on new features

The real value of Lighthouse CI shows up less in the absolute score than in comparing two consecutive measurements. If a merge request's accessibility score drops noticeably against the target branch's state, that points to a concrete regression, even if the absolute value still clears the general threshold. This relative check catches issues a plain threshold comparison would miss entirely.

Rolling out new components, such as a new product filter or a reworked checkout step, is a good moment for a targeted comparison of the affected page before and after the change, because new interactive elements especially tend to introduce missing labels, insufficient contrast, or controls that cannot be focused, without any of that being obvious during everyday manual testing.

6. What the Lighthouse accessibility score does not cover

Much like axe-core, the Lighthouse accessibility score is based on a limited set of criteria that can be checked automatically, and it therefore covers only part of the WCAG success criteria. Keyboard operability across the whole page, a logical focus order, or the actual quality of error messages cannot be captured by an automated score, which is why a high Lighthouse value must never be treated as equal to full accessibility.

For that reason, Lighthouse CI never replaces a manual audit or testing with real users. It complements both by adding continuous, automated observation that holds a baseline quality between the bigger manual reviews and reliably surfaces sudden technical regressions.

7. Establishing reporting and alerting across the team

Lighthouse CI can upload results to a dedicated Lighthouse CI server or a compatible storage service, building a searchable history of every run that can be charted across weeks and months. That visibility matters, because it keeps accessibility from fading into an abstract background goal and instead turns it into a concrete, observable metric sitting right next to performance metrics like Largest Contentful Paint on the same dashboard.

It is also worth setting up a notification, for example through a Slack or Teams webhook, that fires as soon as a merge request drops below the defined threshold, so the responsible team can react immediately instead of only discovering the regression at the next scheduled reporting meeting.

8. Combining Lighthouse CI and an axe-core CI runner

Lighthouse CI and a dedicated axe-core CI runner do not compete, they check different layers. Lighthouse delivers an aggregated score across multiple categories and is particularly well suited for watching a trend over time, while an axe-core runner delivers detailed, individual findings with an exact element and rule and is better suited for targeted bug fixing.

In a mature pipeline, both tools run in parallel. Lighthouse CI watches the long-term trend and blocks on a significant score drop, while the axe-core runner delivers the concrete list of violations on every run that a developer can act on directly. That combination pairs macro-level monitoring with precise micro-level diagnosis.

9. Practical example: continuous monitoring of a product detail page

For a Magento product detail page in the Hyvä theme, Lighthouse CI can be configured so that every merge request automatically triggers three runs against a representative sample URL and the median accessibility score gets compared against the main branch's last known value. If the score drops by more than two percentage points, the job fails and the merge request stays blocked until the cause is identified.

In practice, a setup like this has repeatedly shown that a new review component or an extra cross-selling carousel introduced insufficient contrast or missing focus indicators, long before those components ever reached production, meaning the fix could happen while the feature was still being built rather than after launch.

Tool Focus Output Best suited for
Lighthouse (DevTools) Single manual run Snapshot in the browser Fast ad hoc check during development
Lighthouse CI Automated, repeated run Historical time series plus threshold gate Continuous monitoring across deployments
axe-core CI runner Detailed individual findings List with element, rule, WCAG criterion Targeted bug fixing in a merge request
Combining both Macro and micro level Trend plus precise diagnosis Mature pipeline with high test coverage

Mironsoft

WCAG audits, accessible Magento shops, and training

Not sure whether the shop is actually accessible?

We audit existing Magento shops against WCAG 2.2, fix concrete barriers in the Hyvä frontend, and train teams so accessibility stays anchored in the development process for good.

WCAG Audit

Systematically review the shop against WCAG 2.2 AA, with a prioritized issue list.

Fixing Barriers

Concrete implementation: keyboard operability, screen reader support, contrast, forms.

Team Training

Raise developer and editor awareness for accessible implementation day to day.

10. Summary

Lighthouse CI Monitoring: Key Takeaways

Continuity

Lighthouse CI measures the accessibility score on every deployment instead of only during a yearly audit.

Thresholds

Assertions in lighthouserc.js define a minimum score and block regressions automatically.

Limits

The score covers only part of the WCAG criteria and never replaces a manual audit or user testing.

Combination

Paired with an axe-core CI runner, monitoring covers both trend level and detail level.

11. FAQ: Lighthouse CI Monitoring: Key Takeaways

1What is the difference between Lighthouse in DevTools and Lighthouse CI?
Lighthouse in DevTools runs a single, manually triggered check in the browser. Lighthouse CI is a standalone tool that runs the same engine automatically and repeatedly, stores results historically, and checks them against defined thresholds.
2How does Lighthouse CI get integrated into a GitLab pipeline?
Lighthouse CI runs as its own CI job after the build, usually through the lhci autorun command with a lighthouserc.js configuration. The job can fail when a threshold is not met, blocking the merge request.
3How should a sensible threshold for the accessibility score be set?
A realistic starting value is based on the page's currently measured actual state, slightly below it, instead of immediately forcing a theoretical ideal of a hundred points. The threshold then gets raised step by step as concrete improvements land.
4Can Lighthouse CI check individual criteria instead of only the overall score?
Yes, the assert configuration lets individual audits such as color-contrast or label get marked as mandatory criteria on their own, independent of the global score, so specific issues can never reach production.
5Why does the relative comparison between two runs matter more than the absolute score?
An absolute threshold misses regressions as long as the score overall still clears it. A relative comparison between a merge request and the target branch also surfaces smaller but concrete declines that would otherwise go unnoticed.
6Does the Lighthouse accessibility score replace a manual audit?
No, the score is based on a limited set of automatically checkable criteria and does not cover keyboard operability, focus order, or the actual clarity of error messages. It never replaces a manual audit or testing with real users, it maintains baseline quality between such reviews.
7Where do Lighthouse CI results get stored over time?
Lighthouse CI can upload results to a dedicated Lighthouse CI server or a compatible storage service, building a searchable history that can be charted across weeks and months.
8How can the team get notified quickly about a regression?
Through a webhook, for example to Slack or Microsoft Teams, that fires as soon as a merge request drops below the defined threshold, so the responsible team can react immediately instead of only at the next scheduled reporting meeting.
9How do Lighthouse CI and an axe-core CI runner complement each other?
Lighthouse CI delivers an aggregated trend over time and suits macro-level monitoring, while an axe-core runner delivers detailed individual findings with an exact element and rule and suits targeted bug fixing better. Together they produce a more complete picture.
10Should Lighthouse CI run against staging or against an empty development page?
Against a real staging environment populated with realistic data, because many accessibility-relevant issues only surface with real content, such as long product names, populated shopping carts, or actual product images.