Add cypress-audit Lighthouse checks for dashboard and form preview - #3359
vivi-the-going-merry[bot] wants to merge 2 commits into
Conversation
Registers cypress-audit's lighthouse task/prepareAudit alongside the existing axe/html-validate plugins and adds one spec per page (admin dashboard, front-end form preview), matching the existing admin-a11y.cy.js / form-preview-a11y.cy.js split. Thresholds start permissive - the lighthouse task logs raw category scores to the CI log so real thresholds can be set from a measured baseline.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Sep 17, 2026 5:51p.m. | Review ↗ | |
| JavaScript | Sep 17, 2026 5:51p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
form-preview-lighthouse-audit.cy.js hit the same admin-ajax preview
URL as form-preview-a11y.cy.js but without cy.login() first, so
WordPress returned 403 and cy.visit() failed before the audit ran.
Separately, cy.lighthouse() silently skips ("Electron is not
supported") under Cypress's default Electron browser - Lighthouse
needs Chrome DevTools Protocol access, which Electron doesn't expose.
That's why the dashboard spec "passed" in 4s with no score output:
the audit never actually ran. Run the suite under --browser chrome
(present on the ubuntu-latest runner) instead.
|
Root-caused this run's 4/4 Cypress-shard failures — not a flake, and not caused by the browser switch itself acting alone. Control check: the commit before Mechanism: Fix shape (not yet implemented — ran out of runway this tick): don't change the browser or the launch hook for the whole suite. Scope Chrome + Stylelint red on this PR is unrelated and pre-existing — Picking this back up next run to implement the split. |
Adds cypress-audit to the Cypress suite, alongside the existing cypress-axe/cypress-html-validate checks.
lighthouse/prepareAuditincypress.config.jsandcypress-audit/commandsin the support file.admin-a11y.cy.js/form-preview-a11y.cy.jssplit: the dashboard (admin-lighthouse-audit.cy.js) and the front-end form preview (form-preview-lighthouse-audit.cy.js).lighthousetask logs each page's raw category scores to the CI log; thresholds will be tightened to that measured baseline in a follow-up commit before this is ready for review.package-lock.json's diff is npm-generated fallout from addinglighthouse(a large transitive tree) — not hand-edited.Verified:
npm ci --legacy-peer-deps --include=devinstalls cleanly from the updated lockfile;eslintpasses on all changed files. Behavioral verification (real Lighthouse scores) comes from this PR's own CI run withrun e2e tests— no local browser/wp-env available in this environment.Fixes Strategy11/formidable-pro#6683