mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 11:24:00 +00:00
test: isolate keyed and keyless Traffic browser sessions
This commit is contained in:
1 parent
77ed0a7c31
commit
116f28a525
2 files changed
+14
-4
No files matched your search
@@ -2,3 +2,4 @@
|
|||||||
- Exercise current vector road sources and published camera bounds in Traffic fixture QA (asturksever, #1281).
|
- Exercise current vector road sources and published camera bounds in Traffic fixture QA (asturksever, #1281).
|
||||||
- Establish browser-level foreground visibility for Traffic QA and reject hidden-page samples (asturksever, #1281).
|
- Establish browser-level foreground visibility for Traffic QA and reject hidden-page samples (asturksever, #1281).
|
||||||
- Supply CORS headers on cross-origin traffic fixtures and report browser exceptions without disabling browser security (asturksever, #1281).
|
- Supply CORS headers on cross-origin traffic fixtures and report browser exceptions without disabling browser security (asturksever, #1281).
|
||||||
|
- Isolate the Traffic keyless browser scenario from the keyed page’s workers and intercepted cache (asturksever, #1281).
|
||||||
+13
-4
@@ -153,7 +153,7 @@ async function main() {
|
|||||||
|
|
||||||
let exitCode = 0;
|
let exitCode = 0;
|
||||||
try {
|
try {
|
||||||
const page = await browser.newPage();
|
let page = await browser.newPage();
|
||||||
// Keep this visible-page regression deterministic even if the OS starts
|
// Keep this visible-page regression deterministic even if the OS starts
|
||||||
// Chrome minimized. Use browser focus emulation, not patched DOM getters.
|
// Chrome minimized. Use browser focus emulation, not patched DOM getters.
|
||||||
const focusSession = await page.createCDPSession();
|
const focusSession = await page.createCDPSession();
|
||||||
@@ -162,7 +162,7 @@ async function main() {
|
|||||||
const response = fixtureResponse(request);
|
const response = fixtureResponse(request);
|
||||||
if (response) void request.respond(response); else void request.continue();
|
if (response) void request.respond(response); else void request.continue();
|
||||||
};
|
};
|
||||||
if (FIXTURES) { await page.setRequestInterception(true); page.on('request', onFixture); }
|
if (FIXTURES) { await page.setCacheEnabled(false); await page.setRequestInterception(true); page.on('request', onFixture); }
|
||||||
await page.setViewport({ width: 1440, height: 900 });
|
await page.setViewport({ width: 1440, height: 900 });
|
||||||
|
|
||||||
// Track flow-tile requests + traffic console lines for (ii)/(iii)/(v).
|
// Track flow-tile requests + traffic console lines for (ii)/(iii)/(v).
|
||||||
@@ -281,7 +281,16 @@ async function main() {
|
|||||||
|
|
||||||
// ── (v) KEYLESS fallback (intercepted — server key untouched) ────────────
|
// ── (v) KEYLESS fallback (intercepted — server key untouched) ────────────
|
||||||
console.log('\n(v) KEYLESS — intercepted status, expect pure simulation...');
|
console.log('\n(v) KEYLESS — intercepted status, expect pure simulation...');
|
||||||
if (FIXTURES) page.off('request', onFixture);
|
// Keyless is an independent fresh-session contract. Close the keyed page
|
||||||
|
// so its workers, terrain work and intercepted cache cannot leak into it.
|
||||||
|
await page.close();
|
||||||
|
page = await browser.newPage();
|
||||||
|
await page.setViewport({ width: 1440, height: 900 });
|
||||||
|
const keylessFocus = await page.createCDPSession();
|
||||||
|
await keylessFocus.send('Emulation.setFocusEmulationEnabled', { enabled: true });
|
||||||
|
page.on('pageerror', error => { pageErrors.push(error.message); console.error('PAGE ERROR:', error.message); });
|
||||||
|
page.on('console', message => { if (message.type() === 'error') console.error('BROWSER ERROR:', message.text()); });
|
||||||
|
await page.setCacheEnabled(false);
|
||||||
await page.setRequestInterception(true);
|
await page.setRequestInterception(true);
|
||||||
const keylessFlowReqs = [];
|
const keylessFlowReqs = [];
|
||||||
page.on('request', (req) => {
|
page.on('request', (req) => {
|
||||||
@@ -299,7 +308,7 @@ async function main() {
|
|||||||
if (response) { void req.respond(response); return; }
|
if (response) { void req.respond(response); return; }
|
||||||
try { req.continue(); } catch { /* already handled */ }
|
try { req.continue(); } catch { /* already handled */ }
|
||||||
});
|
});
|
||||||
await page.reload({ waitUntil: 'domcontentloaded', timeout: 60000 });
|
await page.goto(APP_URL, { waitUntil: 'domcontentloaded', timeout: 60000 });
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(
|
||||||
() => window.__godsEyeView?.viewer && window.__godsEyeView?.dataManager,
|
() => window.__godsEyeView?.viewer && window.__godsEyeView?.dataManager,
|
||||||
{ timeout: 60000 },
|
{ timeout: 60000 },
|
||||||
|
|||||||
Reference in new issue
Block a user