Closed
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ShouldClickOnCheckboxInputAndToggle: filtermouseout/mouseleaveevents in headful mode, matching upstream behavior where the mouse cursor can trigger these extra events when leaving the viewport in headed browsersShouldWaitForSelectToBeEnabled: usemousedownevent withevent.preventDefault()instead ofonclick, matching upstream to prevent the select dropdown from opening and blocking the test in headful modeShouldWaitForStablePosition: addrafrafcall before clicking to ensure Firefox kicks in the CSS transition animation before Playwright attempts the clickShouldClickTheButtonWhenWindowInnerWidthIsCorrupted: correct typo (innerWith->innerWidth) and useObject.definePropertyper upstreamTestConstants.IsHeadlesshelper for headful-conditional test logic[page-click.spec.ts] *headful expected-failure entry fromTestExpectations.local.jsonCloses #124
Test plan
HEADLESS=false dotnet testwith--filter "ClassName=PlaywrightSharp.Tests.PageClickTests"for chromium and verify all tests passdotnet test --filter "ClassName=PlaywrightSharp.Tests.PageClickTests"dotnet build ./src/PlaywrightSharp.slncompiles cleanly (0 errors)🤖 Generated with Claude Code