Skip to content

Fix frame-hierarchy headful test failures#152

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

Fix frame-hierarchy headful test failures#152
kblok wants to merge 1 commit intomainfrom
fix/issue-122

Conversation

@kblok
Copy link
Copy Markdown
Member

@kblok kblok commented Mar 28, 2026

Summary

  • Fixed ShouldReportDifferentFrameInstanceWhenFrameReAttaches to wait for FrameAttached instead of FrameNavigated, matching upstream Playwright behavior. The wrong event caused timeouts in headful mode where event timing differs from headless.
  • Added missing PageEvent.FrameAttached to enable WaitForEventAsync(PageEvent.FrameAttached).
  • Fixed FrameUtils.DumpFrames to sort child frames by URL then name, matching upstream's deterministic ordering and preventing non-deterministic test failures.
  • Removed the [frame-hierarchy.spec.ts] * expected-failure entry from TestExpectations.local.json.

Closes #122

Test plan

  • Verify dotnet build ./src/PlaywrightSharp.sln passes with zero errors
  • Run frame-hierarchy tests in headful mode: HEADLESS=false dotnet test ./src/PlaywrightSharp.Tests/PlaywrightSharp.Tests.csproj --filter "ClassName=PlaywrightSharp.Tests.FrameHierarchyTests" -f net10.0
  • Run frame-hierarchy tests in headless mode to confirm no regressions: dotnet test ./src/PlaywrightSharp.Tests/PlaywrightSharp.Tests.csproj --filter "ClassName=PlaywrightSharp.Tests.FrameHierarchyTests" -f net10.0

🤖 Generated with Claude Code

Two root causes fixed:
1. ShouldReportDifferentFrameInstanceWhenFrameReAttaches waited for
   FrameNavigated instead of FrameAttached (matching upstream), causing
   timeouts in headful mode where event timing differs.
2. DumpFrames did not sort child frames by URL then name, unlike upstream,
   leading to non-deterministic ordering in ShouldHandleNestedFrames.

Added missing PageEvent.FrameAttached to enable WaitForEventAsync usage.
Removed the [frame-hierarchy.spec.ts] expected-failure entry.

Closes #122

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: frame-hierarchy.spec.ts (headful)

1 participant