storebound/tests/fixtures/console/_common.js
CRT 1d2978d0bb console fill: opens the form itself and reuses the owner's Chrome sign-in
Navigation after sign-in (navPlan + navigate): App Store Connect Apps > + > New App
(EN/TR), App Privacy by /apps/<appId>/distribution/privacy or the app list, Play app
list by package name > Policy and programs > App content > Start / Manage. Every
navigation click goes through navClick: the click gate stays absolute, only a link
named exactly Start / Manage / Başla / Yönet passes. Each step is logged; a step not
found in time or two matching apps -> the printed steps and wait (no crash).
The TR gate now refuses "uygula" (apply) but not "uygulama" (app).

Browser (cli/console/session.ts): attach to a Chrome with remote debugging (--cdp or
DevToolsActivePort), else on macOS a temporary profile with only Local State and the
profile's Cookies filtered to the console hosts, opened in real Chrome and deleted at
the end, else storebound's own profile (--fresh-profile). Cookies are never printed.
Desktop: fresh_profile option, the dialog says it uses the Chrome sign-in.
Tests: navigation fixtures (ASC EN/TR, Play list, App content, missing step,
duplicates, deny-listed decoys), session file selection, host filter, cleanup, and a
real-Chrome copy-mode test on a throwaway profile and a local site.
2026-10-11 18:21:35 +00:00

20 lines
1.2 KiB
JavaScript

// Shared by the console fixtures (modeled pages, not recorded): records every click on a button, link, menu item or row
// (the engine must never click a save / submit / publish / create / next control) and lets a test act as the owner
// (window.__next() shows the next step, like the owner pressing Next). Navigation pages keep the log across pages in
// sessionStorage (window.__navClicks).
window.__clicks = [];
const navLog = () => { try { return JSON.parse(sessionStorage.getItem('navClicks') || '[]'); } catch { return []; } };
window.__navClicks = navLog;
document.addEventListener('click', e => {
const b = e.target.closest('button, a, [role="button"], [role="menuitem"], [role="link"], [role="row"], tr');
if (!b) return;
const name = (b.getAttribute('aria-label') || b.textContent).trim().replace(/\s+/g, ' ');
if (b.matches('button')) window.__clicks.push(b.textContent.trim());
try { sessionStorage.setItem('navClicks', JSON.stringify([...navLog(), name])); } catch { /* file: pages */ }
}, true);
window.__step = 0;
window.__next = () => {
const steps = [...document.querySelectorAll('[data-step]')];
window.__step = Math.min(window.__step + 1, steps.length - 1);
steps.forEach((s, i) => { s.hidden = i !== window.__step; });
};