From 55ab5fca5ff35d94c8ab700b80717617b1ba3a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Kondratiuk?= Date: Thu, 5 Nov 2026 11:13:48 -0300 Subject: [PATCH 1/3] Throw on inputValue and isChecked of the wrong element, click ARIA radios on uncheck Ports tester-army/e2e#1552 (d2556bc). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK --- COMPATIBILITY.md | 4 +- .../content/docs/api/E2E.Engine/NodeStates.md | 17 +++++++ docs-site/src/content/docs/api/E2E/Locator.md | 6 +-- docs-site/src/content/docs/docs/index.mdx | 2 +- .../src/content/docs/migrate/playwright.mdx | 10 ++-- skills/e2e-dotnet/references/writing-tests.md | 12 +++-- src/E2E.Mobile/SnapshotProjection.cs | 1 + src/E2E.WinApp/UiaProjection.cs | 1 + src/E2E/Engine/DocumentEngine.cs | 1 + src/E2E/Engine/Observation.cs | 9 +++- src/E2E/Engine/PageScript.cs | 13 +++-- src/E2E/Engine/WebEngine.cs | 9 +++- src/E2E/Internal/Roles.cs | 24 ++++++++- src/E2E/Locator/Screen.cs | 19 +++++-- tests/E2E.NUnit.Tests/Check/PageCheckTests.cs | 44 +++++++--------- .../LocatorConvenienceTests.cs | 51 +++++-------------- .../ThroughTheElementTargetTests.cs | 29 +++++++++++ .../ThroughTheLocatorTargetTests.cs | 29 +++++++++++ .../ExpectAsyncValue/ToHaveValueTests.cs | 1 - .../LocatorBasics/InputValueTests.cs | 27 ++++++++++ .../IsCheckedAndIsEnabledTests.cs | 12 ++++- ...riptedEngineLocatorReadsAndQueriesTests.cs | 6 ++- .../E2E.Tests/ScriptedScreen/ScriptedScene.cs | 1 + 23 files changed, 233 insertions(+), 95 deletions(-) create mode 100644 tests/E2E.Tests/LocatorBasics/InputValueTests.cs diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index dcf1a11fb..bf3c6e569 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -37,7 +37,7 @@ Names are C# versions of the JavaScript API: `agent.act` is `ActAsync`, `screen. - `Assert.Ignore`, `[Retry]`, `[Timeout]`, and `[Category]` - Screen queries: role, text, label, test id, placeholder, display value, `filter` (`hasText`, `hasNotText`, `has`, and `hasNot`), `or`, `first`, `last`, `nth`. A locator offers every query kind, scoped to its matches' descendants. Every query takes a `TextMatch`: a string or a .NET `Regex`, tested against the whitespace-normalized text. A string matches the whole text, case-sensitively, unless `exact` is false, which makes it a case-insensitive substring, as upstream. `RoleOptions` carries `name`, `checked`, `disabled`, `selected`, `expanded`, `pressed`, and `level`, and `img` is read as `image`. A role query never matches a hidden node; the other kinds keep hidden nodes unless `Visible` is set, as upstream. `ScrollIntoViewAsync` acts on a hidden or disabled match, as upstream's `performUntil` reads no state (the web engine's Playwright call needs no visibility); every other action still waits for an enabled match. A text query leaves out a match with no box (a `Rect` with a zero side; a node that reports no `Rect` counts as boxed) when a match with a box exists, because upstream's web tree lists no box-less node and this tree does (a zero-sized input inside a label does not stand in for the label). A label's text is listed when its control has no box. `getByLabel` matches any node whose accessible name matches, as the upstream reference resolver does. On the web, upstream resolves text, label, and `hasText` through Playwright on the real DOM, and the port reads the same things off its tree: `getByText` and `hasText` match the element's DOM text (every descendant's text in place, no separator between two blocks, a button input's value, script and style text left out), so a placeholder, a title, an `aria-label`, or the control a label names is no text, and the label itself answers; `getByLabel` matches the node's `aria-label`, the elements its `aria-labelledby` names, and its `