From aa3e98fd1d39daa0f363f05eb49d1a8fe232c8ce Mon Sep 17 00:00:00 2001 From: Konstantin Tursunov Date: Mon, 10 Aug 2026 17:01:48 +0800 Subject: [PATCH] fix(stand): pin the UI journeys to the legacy shell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The portal became opt-out: an absent `insight.portal` key now renders the portal, so a fresh browser context stopped meaning "the dashboard shell these journeys were written against" and 12 of 17 journeys timed out inside the portal UI. The context fixture now seeds `insight.portal = "false"` via an init script, which runs before any app code on every page — the one moment the flag is guaranteed to precede the first read. The suite's tested surface stays the legacy shell, stated explicitly, until portal journeys exist. Verified against a stand on the portal-default-on frontend: without the flag a previously green journey fails; with it the UI suite passes 17 of 17. Signed-off-by: Konstantin Tursunov --- tests/stand/ui/conftest.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/stand/ui/conftest.py b/tests/stand/ui/conftest.py index 907152a54..055d61035 100644 --- a/tests/stand/ui/conftest.py +++ b/tests/stand/ui/conftest.py @@ -26,7 +26,8 @@ from __future__ import annotations -from playwright.sync_api import expect +import pytest +from playwright.sync_api import BrowserContext, expect # Playwright's own defaults are already generous where it matters — 30s for # actions and navigation — so they are left alone. `expect()` is the exception: @@ -34,3 +35,18 @@ # and raising it is what lets the journeys use web-first assertions instead of # sleeping or retrying. expect.set_options(timeout=15_000) + + +@pytest.fixture +def context(context: BrowserContext) -> BrowserContext: + """Every journey drives the legacy dashboard shell, stated explicitly. + + The portal became opt-out (an ABSENT `insight.portal` key renders it), so + a fresh browser context stopped meaning "the shell these journeys were + written against" and every selector started timing out inside the portal. + The suite's tested surface stays the legacy shell until portal journeys + exist; the init script runs before any app code on every page, which is + the one moment the flag is guaranteed to precede the first read. + """ + context.add_init_script("window.localStorage.setItem('insight.portal', 'false')") + return context