Skip to content

Extract LocatorEngine so its upstream tests port as written - #1002

Merged
kblok merged 1 commit into
mainfrom
issue-994-locator-engine
Nov 3, 2026
Merged

kblok merged 1 commit into
mainfrom
issue-994-locator-engine

Conversation

@kblok

@kblok kblok commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

The retries, deadlines, resolves, and the context a call carries lived in Screen and Locator, so upstream's locator-engine.test.ts could not run against an engine. They now live in LocatorEngine (Locator/LocatorEngine.cs), and Screen and Locator hand it their query. No behavior changes. The origin test now checks the origin at the engine that adds it, so it is no longer Partial_.

Upstream parity

Upstream change ported: LocatorEngine and its tests, tester-army/e2e packages/e2e/src/locator/engine.ts and packages/e2e/tests/unit/locator-engine.test.ts, last changed in 79e2e13d3365 (e2e-inc/e2e#1416), read at 50fa7afc1a6f.

Tests (LocatorEngine/): the origin it is whole. New whole ports: five resolve retry its, the reads that do not wait (resolveNow, readNow, readAllNow), isNodeVisible, and the two visible-query its that hand a query to the engine. ScriptedLocatorEngine is upstream's makeEngine.

Partial: Partial_ReadNow_re_resolves_after_a_stale_resolve_... and Partial_Reads_every_current_match_... count session.read calls, which the port does not have (a locate answers the nodes).

Not ported: the its that need session.read to go stale (read retry 1 to 3, read contract, readAllNow stale and failure, readNow stale between resolve and read), secret fill (no engine fillSecret), AttemptBudget.capped (no AttemptBudget), the cross-realm describe (.NET has no second module registry), and locator failure candidate counts (not in the port yet: #1001).

.NET-only symbols:

  • LocatorEngineOptions: the session as a set of calls, since the attempt reads the screen through its scope and a test builds an engine from functions.
  • LocatorEngine.DeadlineFor: upstream's deadline; Deadline is the type's name.
  • LocatorEngine.TimeoutOf, SessionPerformAsync, SessionPerformAtAsync: the session seam, used by Screen and the screenshot code.
  • LocatorEngine.ResolveOnceAsync also resolves over an observation for an engine with no locate.
  • Test: NET_only_a_session_wires_the_test_origin_to_the_engine_a_test_acts_on keeps the old E2ESession wiring check.

Known gaps, unchanged by this PR: PerformUntilAsync records no event and PerformAsync checks the node is enabled (upstream has one performUntil); screen.swipe still gets its context in E2ESession.

COMPATIBILITY.md is updated. The public API is unchanged, so SKILL.md and the docs-site need no edit.

Closes #994

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK

The retries, deadlines, resolve, and the operation context a call carries lived in Screen and Locator. They now live in LocatorEngine (locator/engine.ts upstream), which Screen and Locator hand their query. Behavior is unchanged.

The origin test, the missing resolve, and the reads that do not wait now port from locator-engine.test.ts without Partial_ where the port has the call.

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

coderabbitai Bot commented Nov 3, 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 27 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 9c1a85e and 54248b9.

Files selected for processing: 16
  • COMPATIBILITY.md
  • src/E2E/Expect/ScreenshotCapture.cs
  • src/E2E/Locator/LocatorEngine.cs
  • src/E2E/Locator/Screen.cs
  • src/E2E/Run/E2ESession.cs
  • tests/E2E.Tests/EngineLocate/WebAndDocumentEngineLocateTests.cs
  • tests/E2E.Tests/Lifecycle/OnOneSharedBrowserAFreshAttemptPerTestTests.cs
  • tests/E2E.Tests/LocatorEngine/IsNodeVisibleTests.cs
  • tests/E2E.Tests/LocatorEngine/LocatorEnginePerformContractTests.cs
  • tests/E2E.Tests/LocatorEngine/LocatorEngineReadAllNowContractTests.cs
  • tests/E2E.Tests/LocatorEngine/LocatorEngineReadsThatDoNotWaitTests.cs
  • tests/E2E.Tests/LocatorEngine/LocatorEngineResolveRetryContractTests.cs
  • tests/E2E.Tests/LocatorEngine/LocatorEngineVisibleQueriesTests.cs
  • tests/E2E.Tests/LocatorEngine/OriginRecordingEngine.cs
  • tests/E2E.Tests/LocatorEngine/ScriptedLocatorEngine.cs
  • tests/E2E.Tests/LocatorEngine/TranslateLocatorErrorMappingTableTests.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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@kblok

kblok commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kblok
kblok merged commit f9115d8 into main Nov 3, 2026
4 checks passed
@kblok
kblok deleted the issue-994-locator-engine branch November 3, 2026 19:57
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.

Extract LocatorEngine so its upstream tests port as written

1 participant