Skip to content

fix(tests): exempt hidden analytics beacons from the alt-text check - #488

Draft
g-despot wants to merge 1 commit into
mainfrom
fix/indexability-beacon-alt-exemption
Draft

fix(tests): exempt hidden analytics beacons from the alt-text check#488
g-despot wants to merge 1 commit into
mainfrom
fix/indexability-beacon-alt-exemption

Conversation

@g-despot

Copy link
Copy Markdown
Contributor

Fixes 3 test_images_have_alt_text failures on main: /weaviate/concepts/data-import, /cloud/quickstart, /cloud/manage-clusters/create.

The suite already exempted analytics beacons, but by hostname (static.scarf.sh). That check went stale when the beacon moved to our own CNAME (pixel.weaviate.cloud), so it began flagging a hidden 1x1 tracking pixel as a content image missing alt text.

Replaces the hostname match with a structural check (display:none, visibility:hidden, aria-hidden, or 1px dimensions) so it will not go stale on the next domain change. Also sets alt="" and aria-hidden on the injected beacon in scarf.js, which is the WCAG-correct markup for a decorative hidden pixel.

Local: the 3 target tests pass, full -m indexability run is 63 passed.

Note: the scarf.js half only takes effect after deploy, since the suite reads the live site.

Draft pending the verifier gate.

The indexability suite already exempted the analytics beacon by hostname
("static.scarf.sh"). That predicate went stale when the pixel moved to our own
CNAME (pixel.weaviate.cloud), so test_images_have_alt_text started failing on
/weaviate/concepts/data-import, /cloud/quickstart and
/cloud/manage-clusters/create.

Repair the exemption structurally instead of by hostname: skip images hidden
from both rendering and the accessibility tree (inline display:none or
visibility:hidden, aria-hidden="true") and 1x1 tracking pixels. Alt text is
meaningless on an image no reader, screen reader or crawler can reach, and the
rule survives the next domain move. The scarf.sh case is kept. Content images
missing alt text are still caught.

Also mark the beacon itself as decorative in scarf.js with alt="" and
aria-hidden="true", which is the correct markup for a hidden pixel.

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant