Name: [FIX] tests, project: stabilise the browser tests that fail on the runbot

State: Killed

PR State: merged

PR Author: David Tran

PR Author Email:

PR: #1280

Committer: David Tran

Committer Email: david.tran@tvtmarine.com

Commit: 0769f72e116dad3b7deb952dcfce52781513f7d1

Description:

                                            [FIX] tests: park the mouse out of the viewport before browser tests

Seven `web` module HOOT/browser tests were deterministically red on
the Viindoo runbot (18.0): four in WebSuite.test_hoot, three in
WebSuite.test_unit_desktop (autocomplete and sortable).

On the Viindoo runbot, the failure signature is byte-identical to a
mouse cursor resting inside the viewport at test-page load. The
runbot's own OS-level cursor position was never directly observed -
only the in-page mechanism is proven: a known cursor position lets
Blink dispatch a genuine TRUSTED pointerover/mouseover event into
whatever element sits under that point on the next focus/scroll/
layout change, corrupting hoot-dom fixture assertions, AutoComplete's
mouseover handlers, and sortable's edge-scroll math.

Add ChromeBrowser._park_mouse_outside_viewport(), which sends CDP
Input.dispatchMouseEvent {type: 'mouseMoved', x: -100, y: -100}
(defensive: logs and never raises on failure). Call it from
HttpCase.browser_js right after _wait_ready succeeds and before
test code runs.

Add addons/web/tests/test_browser_harness.py
(BrowserHarnessCursorHygieneTests) as a guard: a permanent
sensitivity proof plus the actual regression guard, both authored
test-first (RED, confirmed failing before the fix, confirmed green
after).

Verified by a prior debug run's toggle on Chrome for Testing
150.0.7871.114 (the runbot's exact build): 7/7 failures reproduced
then cleared, byte-identical output both directions. Re-confirmed
on the finished fix with an integrated run on a fresh ephemeral
Odoo 18.0 instance (core-only, web module), same Chrome build:
0 failed, 0 error(s) of 4 tests - both new guard-test methods
green, WebSuite.test_hoot 199/199, and
WebSuite.test_unit_desktop[@web/core/autocomplete,@web/core/utils/sortable]
33/33, the exact previously-failing set. No existing test, hoot, or
hoot-dom file was touched.

Signed-off-by: David Tran <david.tran@tvtmarine.com>
                                            

Branch: 18.0

Age: Not started

Up-time: Not finished