fix(admin): complete processing diagnostics and failure evidence

This commit is contained in:
cesnimda
2026-10-29 07:24:49 +01:00
parent 0dd788bdfc
commit 3255da9fc6
15 changed files with 450 additions and 36 deletions
@@ -58,6 +58,8 @@ for (const [language, mode] of [['en', 'light'], ['nb', 'dark']] as const) {
await fs.writeFile(`${extension}/background.js`, 'globalThis.auditZoomReady = true;');
const context = await playwright.chromium.launchPersistentContext(info.outputPath('local-browser-profile'), {
channel: 'chromium', headless: true, viewport: null, deviceScaleFactor: undefined,
// The bundled browser otherwise disables the extension that owns real tab zoom.
ignoreDefaultArgs: ['--disable-extensions'],
args: ['--window-size=1280,900', `--disable-extensions-except=${extension}`, `--load-extension=${extension}`],
});
const admin = await playwright.request.newContext();
@@ -65,6 +67,7 @@ for (const [language, mode] of [['en', 'light'], ['nb', 'dark']] as const) {
let createdAdminId: string | undefined;
const records: unknown[] = [];
try {
const worker = context.serviceWorkers()[0] || await context.waitForEvent('serviceworker');
await context.route('**/*', route => {
const url = new URL(route.request().url());
return ['localhost', '127.0.0.1'].includes(url.hostname) || ['data:', 'blob:', 'about:'].includes(url.protocol) ? route.continue() : route.abort();
@@ -77,7 +80,6 @@ for (const [language, mode] of [['en', 'light'], ['nb', 'dark']] as const) {
await page.emulateMedia({ reducedMotion: 'reduce' });
await page.goto('http://localhost:3300/login');
await expect(page.getByRole('heading', { name: translations[language].signInTitle, exact: true })).toBeVisible();
const worker = context.serviceWorkers()[0] || await context.waitForEvent('serviceworker');
const zoom = async (factor: number) => {
const result = await worker.evaluate(async factor => {
// The extension changes real tab zoom, rather than emulating a narrow viewport or pinch.