Skip to content

Fix page-click.spec.ts headful test failures#157

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

Fix page-click.spec.ts headful test failures#157
kblok wants to merge 1 commit intomainfrom
fix/issue-124

Conversation

@kblok
Copy link
Copy Markdown
Member

@kblok kblok commented Mar 28, 2026

Summary

  • Fix ShouldClickOnCheckboxInputAndToggle: filter mouseout/mouseleave events in headful mode, matching upstream behavior where the mouse cursor can trigger these extra events when leaving the viewport in headed browsers
  • Fix ShouldWaitForSelectToBeEnabled: use mousedown event with event.preventDefault() instead of onclick, matching upstream to prevent the select dropdown from opening and blocking the test in headful mode
  • Fix ShouldWaitForStablePosition: add rafraf call before clicking to ensure Firefox kicks in the CSS transition animation before Playwright attempts the click
  • Fix ShouldClickTheButtonWhenWindowInnerWidthIsCorrupted: correct typo (innerWith -> innerWidth) and use Object.defineProperty per upstream
  • Add TestConstants.IsHeadless helper for headful-conditional test logic
  • Remove overly broad [page-click.spec.ts] * headful expected-failure entry from TestExpectations.local.json

Closes #124

Test plan

  • Run HEADLESS=false dotnet test with --filter "ClassName=PlaywrightSharp.Tests.PageClickTests" for chromium and verify all tests pass
  • Run headless tests to confirm no regressions: dotnet test --filter "ClassName=PlaywrightSharp.Tests.PageClickTests"
  • Verify dotnet build ./src/PlaywrightSharp.sln compiles cleanly (0 errors)

🤖 Generated with Claude Code

Update tests to match upstream Playwright behavior for headful mode:
- ShouldClickOnCheckboxInputAndToggle: filter mouseout/mouseleave events
  in headful mode (mouse can leave the viewport in headed browsers)
- ShouldWaitForSelectToBeEnabled: use mousedown with preventDefault()
  instead of onclick to prevent dropdown from opening in headful mode
- ShouldWaitForStablePosition: add rafraf call before clicking to let
  Firefox kick in the CSS animation
- ShouldClickTheButtonWhenWindowInnerWidthIsCorrupted: fix typo
  (innerWith -> innerWidth) and use Object.defineProperty per upstream

Add TestConstants.IsHeadless helper for headful-conditional test logic.
Remove overly broad [page-click.spec.ts] * headful expected-failure entry.

Closes #124

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-click.spec.ts (headful)

1 participant