Skip to content

[pending ParakhAI-frontend#443] Invite Evaluator dialog a11y labels - #18

Draft
saqibmanan wants to merge 1 commit into
mainfrom
test-sync/ParakhAI-frontend-pr443
Draft

saqibmanan wants to merge 1 commit into
mainfrom
test-sync/ParakhAI-frontend-pr443

Conversation

@saqibmanan

@saqibmanan saqibmanan commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Pending: covers open CivicDataLab/ParakhAI-frontend#443 (head db9cc7e89c43f437c18e7e7b565a486ab60fd598). Skipped in CI until it merges. Safe to merge before it.

Source PR

CivicDataLab/ParakhAI-frontend#443 — open since 2026-07-31, base dev.

What changed (from the diff, not the title)

AuditorInvitation.tsx (the "Invite Evaluator" dialog, opened per model-version from the AI model detail page) has two unlabelled controls: the "Select Evaluator" <select> and the "Notes (optional)" <textarea> each have a <label> rendered visually above them with no htmlFor, and no matching id on the control. The PR adds htmlFor="select-evaluator"/id="select-evaluator" and htmlFor="evaluator-notes"/id="evaluator-notes".

The PR description notes it deliberately does NOT touch the <Select> components in the New Evaluation wizard (already correctly labelled via opub-ui's internal useId()), and separately flags two other mislabelled elements (EvaluationConfiguration.tsx's auditType/auditScope label targets and ModelSelectionModal.tsx's evaluator-technical double-label) as out of scope for #443 — those are not covered here either, consistent with the source PR's own scoping.

Category added, and why

  • accessibility — this is purely an a11y/markup fix with no functional behavior change, which is exactly what that marker is for. No e2e needed alongside it; nothing about the dialog's actual flow changes.

Test added

tests/accessibility/test_auditor_invitation_a11y.py:

  • test_evaluator_select_has_accessible_label — opens the dialog, asserts page.get_by_label("Select Evaluator") resolves to exactly one element.
  • test_notes_textarea_has_accessible_label — same, for page.get_by_label("Notes (optional)").

Why this is a real regression check, not a flipped assertion

get_by_label() resolves through Playwright's actual accessible-name algorithm — the same one assistive tech uses — not a nearby-text heuristic. With no htmlFor/id, it resolves to zero elements even though the label text sits visibly right above the control; after the fix it resolves to exactly one. That's the real mechanism the bug affects, so this assertion can only pass once the association genuinely exists.

Page Object gap filled

Nothing previously opened this dialog. Added:

  • locators/models_locators.py: INVITE_AUDITOR_DIALOG = "[role='dialog']:has-text('Invite Evaluator')"
  • pages/models_page.py: click_invite_auditors() (click the per-version "Invite Evaluators" link and wait for the dialog), is_invite_auditor_dialog_visible()

No raw selectors in the test file itself; it uses the Page Object method to open the dialog and Playwright's own get_by_label (an accessibility-tree query, not a raw CSS selector) for the actual assertion.

Red/green proof — UNVERIFIED, no credentials in this environment

This is the cloud routine's sweep run; it has no TEST_EMAIL_1/TEST_PASSWORD_1, so it cannot reach the AI Maker dashboard or model detail page at all. Collection and the pending_pr gate ARE verified locally:

$ pytest tests/accessibility/test_auditor_invitation_a11y.py --collect-only -q
collected 2 items  (no --strict-markers failure)

$ pytest tests/accessibility/test_auditor_invitation_a11y.py -m "accessibility" -rs -v
SKIPPED [2] tests/accessibility/test_auditor_invitation_a11y.py: pending_pr ParakhAI-frontend#443: not merged yet

(That skip reason came from a real, unauthenticated call to the GitHub API confirming #443 is still open.)

What a human with credentials must run for the actual red/green proof:

  1. Temporarily remove the pending_pr marker, run against dev now → expect FAIL (get_by_label finds 0 elements on both, current markup has no htmlFor/id).
  2. gh pr checkout 443 on ParakhAI-frontend, serve locally per SKILL.md §6 (note: with the stub-auth local-serve setup the header nav won't render, so this specific flow may be easier to verify directly against dev once #443 reaches it, rather than via local serve — flagging that rather than guessing at a workaround) → expect PASS.
  3. Restore the marker, confirm the skip reason shown above.

Label on both tests: UNVERIFIED — not executed, no credentials in this cloud sandbox.

Gaps / follow-ups

  • If #443's head moves before merge (open since 2026-07-31), re-diff before relying on this.
  • The click_invite_auditors() helper skips (doesn't fail) if no model/version with an "Invite Evaluators" link is visible — depends on live dev data having an invitable version.
  • Not covered: the two other mislabelled elements the PR author flagged as out-of-scope (EvaluationConfiguration.tsx's dangling htmlFors, ModelSelectionModal.tsx's double-labelled radio) — they're genuinely separate issues, not part of this diff.

…y labels)

Covers the open dev PR that links the 'Select Evaluator' <select> and the
'Notes (optional)' <textarea> in the Invite Evaluator dialog to their
<label>s. Gated with pending_pr("ParakhAI-frontend#443") so it skips
until the source PR merges.

Proves the fix through Playwright's get_by_label(), which resolves
through the real accessible-name algorithm rather than nearby text, so a
missing htmlFor/id genuinely fails it.

Adds a small Page Object gap fill (click_invite_auditors +
INVITE_AUDITOR_DIALOG locator) since nothing previously opened this
dialog.

Copy link
Copy Markdown
Contributor Author

Test Summary is red, but not because of this PR's test. This PR only adds tests/accessibility/test_auditor_invitation_a11y.py; the Accessibility suite itself ran clean (success). Test Summary fails because scripts/suite_summary.py aggregates the full E2E matrix too, and that matrix has pre-existing failures unrelated to this diff:

  • shard 1/3: test_add_model_flow.py::TestCDSAddModelEditor::test_cds003_autosave_indicator_not_shown_with_empty_fields — worker crash (gw3), likely infra flake.
  • shard 2/3: test_evaluations.py::TestEvaluationDetail::test_back_to_list_button_navigates_correctly and TestEvaluationsPagination::test_status_filter_resets_to_first_page — navigation/timeout on button[aria-label='Filter Status'].
  • shard 3/3: 9 failures in test_prompt_libraries.py (category badges not visible, search not filtering) — looks like a real regression on dev's prompt-library feature, not a flake.

None of these touch anything in this PR's diff. No fix for them exists yet in this repo (checked). Not re-running the full ~20min matrix to confirm flakiness since shard 3's failures are consistent assertion failures, not timeouts — that one looks like a genuine dev-environment issue worth its own investigation, separate from this PR.


Generated by Claude Code

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