Desktop boot check: the dry-run preview is accepted whenever it shows, also during waits

This commit is contained in:
CRTkafa 2026-10-23 10:44:54 +08:00
parent 26ebb64458
commit f052831fea

View file

@ -236,8 +236,10 @@ interface CaseResult { name: string; ok: boolean; problems: string[]; visited: n
* going on: the native confirm dialog after it is what each case checks. */
async function newPage(ctx: { newPage(): Promise<import('playwright').Page> }): Promise<import('playwright').Page> {
const page = await ctx.newPage();
await page.addLocatorHandler(page.locator('.ds-scrim:has(.dr-cmd)'), async () => {
await page.locator('.ds-scrim:has(.dr-cmd) .btn-primary').click();
// a person reads the preview and presses Continue, also while the check only waits (no action of its own to block)
await page.addInitScript(() => {
const go = () => { const b = document.querySelector<HTMLButtonElement>('.ds-scrim:has(.dr-cmd) .btn-primary'); if (b) b.click(); };
new MutationObserver(go).observe(document, { childList: true, subtree: true });
});
return page;
}