From 5e97430edd04236b2a5515fc06e2a28d04d5df61 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 10 Nov 2026 11:25:30 +0100 Subject: [PATCH] Fail a click that cannot land: hit-test the point before pressing it click, dblclick, hover, check, uncheck and the source of a drag check what is at the point they press, wait while something else would receive it, and fail naming what does (or that nothing is there). Before, a click on a covered or off-screen element reported success and a later step timed out far from the cause. Co-Authored-By: Claude Sonnet 5.5 --- DECISIONS.md | 12 ++ docs/journeys/commands.md | 12 ++ src/Nullean.Cdp/Locator.cs | 63 ++++++++++- tests/Nullean.Cdp.Tests/Live/ClickHitTests.cs | 107 ++++++++++++++++++ tests/Nullean.Cdp.Tests/site/cover.html | 23 ++++ 5 files changed, 214 insertions(+), 3 deletions(-) create mode 100644 tests/Nullean.Cdp.Tests/Live/ClickHitTests.cs create mode 100644 tests/Nullean.Cdp.Tests/site/cover.html diff --git a/DECISIONS.md b/DECISIONS.md index c198fe4..f47024f 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -573,4 +573,16 @@ published by hand by the owner. - **No allow-list option was added**: `AllowedHosts` already is the run-level default. - **A click that hits nothing is not this change**: at the phone viewport `find role link click` completed with no effect. The default viewport is the fix for that site; a click that reports it missed its target is separate. +## A click that cannot land fails + +- **Pointer actions hit-test their point.** Chrome delivers `Input.dispatchMouseEvent` to whatever is at the point, so a + click on a covered or off-screen element "succeeds" and does nothing, and the failure shows at a later step that + times out far from the cause. `click`, `dblclick`, `hover`, `check`, `uncheck` and the source of `drag` check + `elementFromPoint` at the point first (into shadow roots, like a click). Scrolling and the target of a drag press + nothing, so they do not. +- **It waits, as Playwright's "receives events" does**, because covers are often transient (a banner fading out); the + step fails with the element that would receive the click, or "nothing is there" off the screen or clipped. +- **Accepted as a hit:** the element, anything inside it, or a `