Restore scratch setup bootstrap and live frontdoor sweep

This commit is contained in:
master
2026-03-09 01:42:24 +02:00
parent abda749ffd
commit c9686edf07
13 changed files with 766 additions and 63 deletions

View File

@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
import { chromium } from 'playwright';
import { authenticateFrontdoor } from './live-frontdoor-auth.mjs';
import { authenticateFrontdoor, createAuthenticatedContext } from './live-frontdoor-auth.mjs';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@@ -417,20 +417,7 @@ async function main() {
headless: true,
args: ['--disable-dev-shm-usage'],
});
const context = await browser.newContext({
ignoreHTTPSErrors: true,
storageState: statePath,
});
const sessionEntries = Array.isArray(authReport.storage?.sessionStorageEntries)
? authReport.storage.sessionStorageEntries
: [];
await context.addInitScript((entries) => {
for (const [key, value] of entries) {
if (typeof key === 'string' && typeof value === 'string') {
sessionStorage.setItem(key, value);
}
}
}, sessionEntries);
const context = await createAuthenticatedContext(browser, authReport, { statePath });
const report = {
generatedAtUtc: new Date().toISOString(),