Skip to content

Add Locator.BlurAsync for web elements (tester-army/e2e#1919) - #2054

Merged
kblok merged 2 commits into
mainfrom
fix/2027-locator-blur
Nov 22, 2026
Merged

kblok merged 2 commits into
mainfrom
fix/2027-locator-blur

Conversation

@kblok

@kblok kblok commented Nov 21, 2026

Copy link
Copy Markdown
Member

What

Adds Locator.BlurAsync(): removes focus from the matched web element (port of e2e-inc/e2e#1919, commit e88153b).

Value

Tests can blur a field (e.g. to trigger validation on blur) without tabbing or clicking elsewhere. Web only: device engines do not declare blur, so it fails with UNSUPPORTED_CAPABILITY there.

Upstream parity

Verdict: complete except the two items under "Not ported".

  • LocatorAction.Blur, BlurAsync (Locator), EngineActionKinds.KnownLocator (upstream KNOWN_LOCATOR_ACTION_KINDS; Locator stays the SPI v1 list), manifest validates actions against it
  • Web engine declares [...Locator, "blur"] and dispatches blur via the prototype's blur (instance overrides bypassed; HTMLElement, SVGElement, MathMLElement), NODE_STALE when detached
  • Manifest schema enum + invalid fixture; mobile/winapp kind-name switches stay exhaustive
  • Docs: engine reference, Playwright migration, SKILL.md, writing-tests reference, API pages (hand-updated: docfx needs .NET 11, unavailable here)

Upstream tests and local match

Upstream Port
testbed controls: blur removes focus only from the matched node ControlsTests.Blur_removes_focus_only_from_the_matched_node
testbed controls: blur works on an input matched by its current value ControlsTests.Blur_works_on_an_input_matched_by_its_current_value
testbed controls: blur removes focus from MathML matched by label ControlsTests.Blur_removes_focus_from_MathML_matched_by_label
locator-engine: locator.blur honors the declared capability LocatorEngine/LocatorBlurTests
surface-of: declares support for blur on web SurfaceOfTests.Declares_support_for_blur_on_web (session-level ActionKinds, the port has no handle)
engine-protocol: schema enum is KNOWN kinds, manifest with blur accepted extended EngineProtocolTests.Partial_Describes_an_engine... (still partial: no describeEngine)
engine manifest invalid fixture schema/fixtures/engine-manifest-v1.invalid.json (existing schema-fixture test)

Not ported

Closes #2027

Tests run (net10.0, Chromium): Controls, LocatorBlur, SurfaceOf, EngineProtocol, SchemaFixtures, DefineEngine all pass. No agent-affecting change, so the full real-model suite was not run.


Generated by Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e22FiWWXZ7dbPtTiZjf
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 886fe4f and c05814e.

Files selected for processing: 24

  • docs-site/src/content/docs/api/E2E.Engine/EngineActionKinds.md
  • docs-site/src/content/docs/api/E2E.Engine/LocatorAction.Blur.md
  • docs-site/src/content/docs/api/E2E.Engine/LocatorAction.md
  • docs-site/src/content/docs/api/E2E.Engine/index.md
  • docs-site/src/content/docs/api/E2E/Locator.md
  • docs-site/src/content/docs/migrate/playwright.mdx
  • docs-site/src/content/docs/reference/engine.mdx
  • schema/engine-manifest-v1.schema.json
  • schema/fixtures/engine-manifest-v1.invalid.json
  • skills/e2e-dotnet/SKILL.md
  • skills/e2e-dotnet/references/writing-tests.md
  • src/E2E.Mobile/DeviceActions.cs
  • src/E2E.WinApp/WindowActions.cs
  • src/E2E/Engine/LocatorAction.cs
  • src/E2E/Engine/Manifest.cs
  • src/E2E/Engine/PageScript.cs
  • src/E2E/Engine/PointerAction.cs
  • src/E2E/Engine/WebEngine.cs
  • src/E2E/Locator/LocatorEngine.cs
  • src/E2E/Locator/Screen.cs
  • tests/E2E.Tests/Controls/ControlsTests.cs
  • tests/E2E.Tests/EngineProtocol/EngineProtocolTests.cs
  • tests/E2E.Tests/LocatorEngine/LocatorBlurTests.cs
  • tests/E2E.Tests/SurfaceOf/SurfaceOfTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e22FiWWXZ7dbPtTiZjf
@kblok
kblok merged commit 7e617f2 into main Nov 22, 2026
5 checks passed
@kblok
kblok deleted the fix/2027-locator-blur branch November 22, 2026 00:58
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.

Upstream: add blur for web elements (tester-army/e2e#1919)

2 participants