Preserve live scope across evidence and registry flows

This commit is contained in:
master
2026-03-09 22:11:08 +02:00
parent dfd22281ed
commit 3ecafc49a3
7 changed files with 104 additions and 1 deletions

View File

@@ -83,6 +83,7 @@ const surfaceConfigs = [
selector: 'main button:has-text("Back to Search")',
expectedUrlPattern: '/evidence/threads',
expectedTextPattern: /evidence threads/i,
requiredUrlFragments: ['tenant=', 'regions='],
},
],
},
@@ -115,6 +116,7 @@ const surfaceConfigs = [
selector: 'a[href*="/registry-admin/audit"], button:has-text("Audit")',
expectedUrlPattern: '/registry-admin/audit',
expectedTextPattern: /audit/i,
requiredUrlFragments: ['tenant=', 'regions='],
},
],
},
@@ -389,7 +391,9 @@ async function verifySurfaceActions(context, surface) {
const bodyText = await collectBodyText(page);
const headingText = firstMatchingHeading(action.expectedTextPattern, headings);
const finalUrl = page.url();
const hasRequiredUrlFragments = (action.requiredUrlFragments ?? []).every((fragment) => finalUrl.includes(fragment));
const ok = finalUrl.includes(action.expectedUrlPattern)
&& hasRequiredUrlFragments
&& matchesPattern(action.expectedTextPattern, headings, bodyText);
results.push({