Skip to content

Fix elementhandle-convenience.spec.ts headful test failures#153

Open
kblok wants to merge 1 commit intomainfrom
fix/issue-111
Open

Fix elementhandle-convenience.spec.ts headful test failures#153
kblok wants to merge 1 commit intomainfrom
fix/issue-111

Conversation

@kblok
Copy link
Copy Markdown
Member

@kblok kblok commented Mar 28, 2026

Summary

  • Move 4 "should be atomic" selector-engine tests from ElementHandleConvenienceTests to SelectorsRegisterTests, matching upstream's selectors-register.spec.ts (these tests were misplaced and used stale create() methods not present in upstream)
  • Fix InnerTextShouldThrow assertion bug: was checking exception1.Message instead of exception2.Message
  • Fix TextContentShouldWork selector to use #inner matching upstream (was #outer)
  • Fix PlaywrightTest attribute typo: "'innerText should throw" -> "innerText should throw"
  • Add missing upstream assertions: GetAttributeAsync("foo") returning null, and IsVisibleAsync/IsHiddenAsync for non-existent elements
  • Remove [elementhandle-convenience.spec.ts] * headful expected-failure entry from TestExpectations.local.json

Closes #111

Test plan

  • Verify dotnet build ./src/PlaywrightSharp.sln succeeds (confirmed locally)
  • Verify headful CI runs pass for elementhandle-convenience tests (no longer skipped)
  • Verify headless CI runs still pass for elementhandle-convenience tests
  • Verify selectors-register atomic tests still pass in their new location

🤖 Generated with Claude Code

Align ElementHandleConvenienceTests with upstream Playwright to fix
headful-mode failures:

- Move 4 "should be atomic" tests to SelectorsRegisterTests where they
  belong in upstream (selectors-register.spec.ts), removing the stale
  create() method from selector engine definitions
- Fix InnerTextShouldThrow: assert exception2.Message instead of
  exception1.Message (copy-paste bug)
- Fix TextContentShouldWork: use #inner selector matching upstream
- Fix PlaywrightTest attribute: remove erroneous leading quote in
  "'innerText should throw"
- Add missing null-return assertions in GetAttributeShouldWork
- Add missing no-such-element assertions in IsVisibleAndIsHiddenShouldWork
- Remove elementhandle-convenience.spec.ts headful expected-failure entry

Closes #111

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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: elementhandle-convenience.spec.ts (headful)

1 participant