From 61ac675f578808e93024162a86d4ae32ff5d7640 Mon Sep 17 00:00:00 2001 From: Pierre Le Fevre Date: Fri, 22 May 2026 15:43:59 +0200 Subject: [PATCH] Tighten real-web expectation to Chromium parity + interactivity (isu issue 271) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Phase 23 real-web soak previously asserted each scenario against a frozen capture of we's own historical render — that's a regression guard, not a correctness bar. Tighten the documented expectation so the golden is a Chromium-captured reference at the same viewport, and so each scenario must exercise at least one user-driven interaction (not just first paint). This commit ships the policy + tooling; the actual per-scenario migration is filed as isu issues 273-279 and lands one merge per follow-up. - PLAN.md Phase 23: new "Golden screenshot policy" and "Interactivity policy" paragraphs; matching exit-criteria lines. - crates/e2e/real-web/README.md: new directory-layout entry for `..chromium.expected.png`, new "Golden screenshot policy" and "Interactivity policy" sections, refreshed soak iteration workflow, refreshed exit-criteria checklist. - crates/e2e/scenarios/real-web/.gitignore: keep `*.chromium.png` / `*.firefox.png` throwaway captures gitignored; commit the canonical `*.chromium.expected.png` golden. - tests/popular-sites/compare.py: new `--write-golden` flag that writes the canonical golden (`..chromium.expected.png`) rather than the throwaway reference. Only `--browser chromium` is accepted with it (Chromium is the parity bar). - tests/popular-sites/test_compare.py: cover the new naming. - tests/popular-sites/README.md: document `--write-golden`. The legacy `..expected.png` files are left in place for now; they will be deleted in each per-scenario migration commit (isu issues 274-278). Co-Authored-By: Claude Opus 4.7 --- .isu/issues.json | 95 +++++++++++++++++++- PLAN.md | 5 +- crates/e2e/real-web/README.md | 107 ++++++++++++++++++----- crates/e2e/scenarios/real-web/.gitignore | 12 ++- tests/popular-sites/README.md | 27 +++--- tests/popular-sites/compare.py | 52 +++++++++-- tests/popular-sites/test_compare.py | 15 ++++ 7 files changed, 266 insertions(+), 47 deletions(-) diff --git a/.isu/issues.json b/.isu/issues.json index da88c82..a394a5d 100644 --- a/.isu/issues.json +++ b/.isu/issues.json @@ -1,5 +1,5 @@ { - "next_id": 273, + "next_id": 280, "issues": [ { "id": 1, @@ -3266,7 +3266,7 @@ "labels": [], "assigned": [], "author": "piefev", - "state": "open", + "state": "closed", "created_at": "2026-05-22T13:19:21Z" }, { @@ -3279,6 +3279,97 @@ "author": "piefev", "state": "open", "created_at": "2026-05-22T13:19:54Z" + }, + { + "id": 273, + "repo": "we", + "title": "Add click/type/wait interactivity commands to e2e scenario DSL", + "body": "Phase 23 / isu 271 follow-up.\n\nThe tightened real-web standard (see PLAN.md Phase 23 'Methodology → Interactivity policy') requires each scenario to include at least one user-driven interaction. The e2e harness today only loads, screenshots, and dumps — it has no way to express \"click the search button\" or \"type into the input\".\n\nScope:\n\n- Refactor the scenario runner so the JS VM is kept alive across commands within a single page session (today `RenderOutput.doc` is detached after `goto`; introduce a `Session` that owns the VM + Document and is re-painted after each interaction).\n- Add DSL commands:\n - `click ` — find the element via `querySelector`, dispatch a synthetic `mousedown`/`mouseup`/`click` event sequence with bubbling, then re-style/re-layout/re-paint.\n - `type ` — focus the element, dispatch `keydown`/`beforeinput`/`input`/`keyup` events per character; update the element's value for ``/`