Skip to content

Fix emulation-focus headful test failures#158

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

Fix emulation-focus headful test failures#158
kblok wants to merge 1 commit intomainfrom
fix/issue-119

Conversation

@kblok
Copy link
Copy Markdown
Member

@kblok kblok commented Mar 28, 2026

Summary

  • Fix assertion order in ShouldFocusPopupsByDefault to match upstream (check popup focus before page focus)
  • Add Firefox headful skip for ShouldChangeFocusedIframe matching upstream it.skip(browserName === 'firefox' && !headless)
  • Add IsHeadless property to TestConstants for runtime headless mode detection
  • Remove [emulation-focus.spec.ts] * expected failure entry from TestExpectations.local.json

Closes #119

Test plan

  • Run emulation-focus tests in headless mode (default): should all pass
  • Run emulation-focus tests in headful mode (HEADLESS=false): all should pass except ShouldChangeFocusedIframe on Firefox (skipped to match upstream)
  • Verify build succeeds with dotnet build ./src/PlaywrightSharp.sln

🤖 Generated with Claude Code

The emulation-focus tests were marked as expected failures in headful
mode, but the Playwright driver already handles focus emulation via
Emulation.setFocusEmulationEnabled (Chromium) and
Emulation.setActiveAndFocused (WebKit). The tests should pass in
headful mode as they do in upstream Playwright.

Changes:
- Fix assertion order in ShouldFocusPopupsByDefault to match upstream
  (check popup focus before page focus)
- Add Firefox headful skip for ShouldChangeFocusedIframe matching
  upstream's it.skip for headed Firefox losing focus
- Add IsHeadless property to TestConstants for runtime headless checks
- Remove [emulation-focus.spec.ts] expected failure entry from
  TestExpectations

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: emulation-focus.spec.ts (headful)

1 participant