From c71bdbbda718435307c2c59a7fac5fb42056b901 Mon Sep 17 00:00:00 2001 From: "pulse-triage[bot]" <249995291+pulse-triage[bot]@users.noreply.github.com> Date: Sat, 3 Oct 2026 04:04:52 +0100 Subject: [PATCH] Capture the recovery procedure after theme and scroll settle Visual inspection caught the desktop manual capture still showing the preceding snapshot section and phone theme transition. Put each checked section at the viewport start and wait for the actual theme transition before retaining the screenshot; product source and guidance are unchanged. Change-source: pulse-maintainer --- .../browser-tests/update-recovery-help.cjs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend-modern/browser-tests/update-recovery-help.cjs b/frontend-modern/browser-tests/update-recovery-help.cjs index 0b377be7c9..0ebdcce9a2 100644 --- a/frontend-modern/browser-tests/update-recovery-help.cjs +++ b/frontend-modern/browser-tests/update-recovery-help.cjs @@ -39,7 +39,11 @@ const { chromium, webkit } = require('playwright'); await page.getByRole('link', { name: '← All documentation' }).click(); await page.getByRole('link', { name: 'Automatic updates', exact: true }).click(); await page.getByRole('heading', { name: 'Rollback', exact: true }).waitFor(); - if (tone === 'dark') await page.evaluate(() => document.documentElement.classList.add('dark')); + if (tone === 'dark') await page.evaluate(async () => { + document.documentElement.classList.add('dark'); + await new Promise((resolve) => requestAnimationFrame(resolve)); + await Promise.all(document.getAnimations().map((animation) => animation.finished.catch(() => {}))); + }); const article = await page.locator('article').innerText(); for (const text of ['Roll back from Update History', 'successful in-app update', 'not necessarily a complete backup', 'Copy errors can leave a partial snapshot', @@ -48,11 +52,15 @@ const { chromium, webkit } = require('playwright'); assert.ok(!article.includes('There is no rollback UI')); assert.ok(!article.includes('sudo rm -rf')); const scope = page.getByRole('heading', { name: 'What an update snapshot contains', exact: true }); - await scope.scrollIntoViewIfNeeded(); + await scope.evaluate((heading) => heading.scrollIntoView({ block: 'start' })); assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1)); await page.screenshot({ path: path.join(artifacts, `${engine}-scope.png`) }); const manual = page.getByRole('heading', { name: 'Manual Rollback', exact: true }); - await manual.scrollIntoViewIfNeeded(); + await manual.evaluate((heading) => heading.scrollIntoView({ block: 'start' })); + await page.waitForFunction(() => { + const heading = document.getElementById('manual-rollback'); + return heading && heading.getBoundingClientRect().top >= 0 && heading.getBoundingClientRect().top < 10; + }); await page.screenshot({ path: path.join(artifacts, `${engine}-manual.png`) }); await page.getByRole('link', { name: 'audit storage and safe recovery', exact: true }).click();