Restore scratch setup bootstrap and live frontdoor sweep
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user