diff --git a/locators/models_locators.py b/locators/models_locators.py index 91fd421..e0ece4e 100644 --- a/locators/models_locators.py +++ b/locators/models_locators.py @@ -50,6 +50,11 @@ class ModelsLocators: START_EVALUATION_LINK = "text=Start Evaluation" # Platform UI uses 'Invite Evaluators' (was 'Auditors' in earlier copy). INVITE_AUDITORS_LINK = "text=/Invite (Auditors|Evaluators)/i" + # The invitation dialog AuditorInvitation.tsx opens per-version. Its + # Dialog.Content title is 'Invite Evaluator' or 'Invite Evaluator for + # Version ' — match the stable prefix. + # Added for test-sync/ParakhAI-frontend-pr443 (a11y label fix). + INVITE_AUDITOR_DIALOG = "[role='dialog']:has-text('Invite Evaluator')" # Playwright's `text=` engine treats commas as part of the literal string, # so multi-selector fallbacks must use CSS-only forms (`:has-text()`). DATE_UPDATED_COL = "text=DATE UPDATED" diff --git a/pages/models_page.py b/pages/models_page.py index 8ebebb2..5d4ec62 100644 --- a/pages/models_page.py +++ b/pages/models_page.py @@ -135,6 +135,31 @@ def is_start_evaluation_visible(self) -> bool: def is_invite_auditors_visible(self) -> bool: return self.is_visible(self.INVITE_AUDITORS_LINK) + def click_invite_auditors(self) -> bool: + """Click the first 'Invite Evaluators' link/button (per model version) + and wait for the AuditorInvitation dialog to open. + + Returns True if the dialog opened, False if there was nothing to + click (e.g. no versions on this model) — callers should skip rather + than fail on False, since that's a data gap, not a product bug. + """ + link = self.page.locator(self.INVITE_AUDITORS_LINK).first + try: + link.wait_for(state="visible", timeout=8_000) + except Exception: + return False + link.click() + try: + self.page.locator(ModelsLocators.INVITE_AUDITOR_DIALOG).first.wait_for( + state="visible", timeout=self.timeout + ) + except Exception: + return False + return True + + def is_invite_auditor_dialog_visible(self) -> bool: + return self.is_visible(ModelsLocators.INVITE_AUDITOR_DIALOG) + def is_past_evaluations_visible(self) -> bool: return self.is_visible(self.PAST_EVALUATIONS_HEADING) diff --git a/tests/accessibility/test_auditor_invitation_a11y.py b/tests/accessibility/test_auditor_invitation_a11y.py new file mode 100644 index 0000000..becaf82 --- /dev/null +++ b/tests/accessibility/test_auditor_invitation_a11y.py @@ -0,0 +1,101 @@ +""" +Pending coverage for CivicDataLab/ParakhAI-frontend#443 +("fix(a11y): label evaluator select and notes textarea in invitation dialog"). + +Open `dev` PR, no coverage yet (test-sync §9 sweep, 2026-10-08). Gated with +`pending_pr` — skipped in CI until GitHub reports #443 merged. + +PR #443 head: db9cc7e89c43f437c18e7e7b565a486ab60fd598 (as of 2026-10-08). +If review drags on, re-check the head hasn't moved before this merges. + +What changed: in the "Invite Evaluator" dialog (AuditorInvitation.tsx, +opened from an AI model's version row via "Invite Evaluators"), the +"Select Evaluator"