test(lint): enforce accessibility-tree selectors in new e2e specs#3192
test(lint): enforce accessibility-tree selectors in new e2e specs#3192punk6529 wants to merge 1 commit into
Conversation
New spec code must locate elements via getByRole/getByLabel/getByTestId/
getByText rather than literal CSS lookups on page.locator(). Accessible
queries keep specs resilient while surfaces change rapidly and double as
a WCAG signal - this lands ahead of the campaign's crawl pack and write
journeys so they are born compliant.
Mechanism: a dedicated single-purpose flat config
(eslint.config.e2e-selectors.mjs) because the main lint surface globally
ignores tests/** and a global ignore cannot be re-included per block.
One no-restricted-syntax rule flags literal-string page.locator() calls;
scoping chains under accessible queries stay allowed. The 35 existing
spec files with locator usage are grandfathered in the config with a
shrink-only ratchet note, so nothing mass-fails.
Wired as an unconditional "Lint e2e selector usage" step in the app PR
CI installed-checks job.
Validation: clean run exits 0 (grandfathered exempt, 6 clean specs
pass); a probe spec with page.locator("div.foo") is flagged; knip and
debt ratchet unchanged; workflow YAML parses.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Punk 6529 <108035228+punk6529@users.noreply.github.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
6529bot general PR review - 2d78ea6Verdict: Needs changes Important
Nice-to-have
Suggested next steps
Prompt for all review comments with AI agents |
6529bot WCAG 2.2 AA analysis - 2d78ea6Verdict: No WCAG findings This PR only adds tooling: a new ESLint flat config ( Note: this is a lint rule that encourages accessibility-tree selectors in e2e specs, which is a positive indirect signal, but it does not itself alter runtime accessibility. Correctness concerns about the rule's coverage are outside the WCAG lane and were already raised in the prior general review. |
6529bot i18n analysis - 2d78ea6Verdict: No i18n findings This PR only adds a dedicated ESLint flat config for e2e selector linting, a CI workflow step, and a No changes needed for i18n. |
6529bot crypto security analysis - 2d78ea6Verdict: No security findings This PR is tooling-only: a new ESLint flat config ( Notes within the crypto-security lane (no action required):
Correctness/coverage gaps in the selector rule (template-literal args, non- |
6529bot general PR review - 2d78ea6Verdict: Needs changes The prior review's Important finding about the AST selector gaps remains fully valid and unaddressed in this head ( Important
Nice-to-have
Resolved since last review
Suggested next steps
Prompt for all review comments with AI agents |
|
6529bot GLM Swarm ReviewVerdict: Advisory only This GLM swarm is advisory and complements, not replaces, existing tests and existing reviewbots. Important
Nice-to-have
Testing feedback loop
Partial reviewer outputOne or more internal advisory reviewer slices were unavailable; the synthesis used the remaining reviewer output.
|
6529bot responsiveness review - 2d78ea6Verdict: Responsive checks passed Root Cause / Summary All 40 checks passed with zero deterministic failures, zero blank screenshots, and Blocking Findings None. There are no deterministic failures, no blank/near-white captures ( Non-Blocking Findings
Platform Coverage
Screenshot evidence: native-mobile /rememes, native-mobile /the-memes, native-mobile /network, native-mobile /, native-mobile /meme-lab, native-mobile /messages, native-mobile /meme-calendar, native-mobile /waves, native-mobile /open-mobile?path=%2Fwaves, native-mobile /notifications, web-mobile /the-memes, electron-desktop /rememes and 28 more in the details. Deterministic responsiveness detailsVerdict: Responsive checks passed
Responsiveness runner summary6529bot Responsiveness SummaryStatus: pass Platform Context
Platform Matrix
Next.js Overlay Diagnostics
Warnings
Slowest Checks
|



Issue
The E2E campaign is about to author several new spec families (crawl pack, write journeys, pseudo-locale assertions) and parallel campaigns (i18n URL routing, WCAG 2.2 AA) will keep reshaping surfaces. Specs that locate elements by CSS break on every markup change; specs that use the accessibility tree survive redesigns and double as a WCAG signal. The convention exists informally — ~389 accessible queries vs 94 literal locators — but nothing enforces it. PR 4 of the E2E architecture campaign (pulled ahead of the spec-writing PRs so they're born compliant).
Fix
One lint rule, new code only, via the repo's grandfather-ratchet idiom.
Changes
eslint.config.e2e-selectors.mjs— dedicated single-purpose flat config (the main lint surface globally ignorestests/**, and a flat-config global ignore can't be re-included per block). Oneno-restricted-syntaxrule flags literal-stringpage.locator()calls; scoping chains under accessible queries remain allowedlint:e2e-selectorspackage script; app-pr-ci gains an unconditional "Lint e2e selector usage" step beside knipValidation
page.locator("div.foo")→ flagged with the actionable message, then removedRisk
Low. New config + one CI step; zero impact on the main lint surface or existing specs. Failure mode is a clear per-line lint error pointing at the config's guidance.
Review Notes
pageonly). Chained.locator()scoping and non-pagereceivers stay legal — tightening can ride the same config later once the grandfather list shrinks.🤖 Generated with Claude Code