Skip to content

Fix page-accessibility tests: broken Equals and outdated expectations#161

Closed
kblok wants to merge 1 commit intomainfrom
fix/issue-89
Closed

Fix page-accessibility tests: broken Equals and outdated expectations#161
kblok wants to merge 1 commit intomainfrom
fix/issue-89

Conversation

@kblok
Copy link
Copy Markdown
Member

@kblok kblok commented Mar 28, 2026

Summary

  • Root cause fix: AccessibilitySnapshotResult.Equals(object) called base.Equals(obj) (reference equality from Object) instead of the typed Equals(AccessibilitySnapshotResult) method. Every NUnit Is.EqualTo() comparison on these objects silently failed.
  • Test alignment with upstream: Updated test expectations to match upstream Playwright (pre-deletion snapshot): added WaitForFunctionAsync for autofocus race condition, updated Chromium roles (img -> image), added Multiline = true for contenteditable textbox, fixed orientation: vertical for Chromium menus, platform-conditional WebKit expectations.
  • Removed incorrect skip annotations: NonEditableTextbox..., CheckboxWith..., and CheckboxWithout... tests were restricted to Chromium-only but upstream runs them on all browsers.
  • Added missing tests: ShouldWorkWhenThereIsATitle and ShouldWorkWithAriaInvalidAccessibilityTree from upstream.

Closes #89

Test plan

  • Run Chromium accessibility tests: PRODUCT=CHROMIUM dotnet test ... --filter "ClassName~PageAccessibility"
  • Run Firefox accessibility tests: PRODUCT=FIREFOX dotnet test ... --filter "ClassName~PageAccessibility"
  • Run WebKit accessibility tests: PRODUCT=WEBKIT dotnet test ... --filter "ClassName~PageAccessibility"
  • Verify no other tests regressed by the Equals(object) fix

🤖 Generated with Claude Code

…ectations

The root cause was AccessibilitySnapshotResult.Equals(object) calling
base.Equals(obj) (reference equality) instead of the typed Equals method,
causing all NUnit Is.EqualTo() assertions to fail. Also updates test
expectations to match upstream: autofocus wait, Chromium role changes
(img->image, vertical orientation on menu), Multiline on contenteditable
textbox, and adds missing tests (title, aria-invalid). Removes incorrect
browser skip annotations on tests that upstream runs on all browsers.

Closes #89

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kblok kblok closed this Mar 30, 2026
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.

Fix failing tests: page-accessibility.spec.ts

1 participant