From ee35b7e84c82cdf90602bcd270601bd870f78493 Mon Sep 17 00:00:00 2001 From: Andrea Manzi Date: Fri, 23 Oct 2026 18:10:06 +0200 Subject: [PATCH] =?UTF-8?q?Prova=20nel=20browser:=20dopo=20=C2=ABContinua?= =?UTF-8?q?=C2=BB=20aspetta=20il=20cambio=20di=20brano=20invece=20di=20con?= =?UTF-8?q?trollarlo=20subito?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017egeN2amL84ErjfgQFtEDn --- tests/browser.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/browser.mjs b/tests/browser.mjs index d633b51..fe0b310 100644 --- a/tests/browser.mjs +++ b/tests/browser.mjs @@ -96,7 +96,9 @@ try { await page.click('#continue'); await settle(page); // Musica: dopo il primo clic suona il brano del paese; muto e volume si ricordano. - assert.ok((await page.evaluate(() => music.current?.src)).endsWith('paese.mp3'), 'musica del paese'); + // Il brano cambia al fotogramma dopo «Continua»: si aspetta quello, senza indovinare i tempi. + const playing = await page.waitForFunction(() => music.current?.src.endsWith('paese.mp3'), null, { timeout: 3000 }).then(() => true, () => false); + assert.ok(playing, 'musica del paese: ' + await page.evaluate(() => music.current?.src)); await page.click('#mute'); await page.locator('#volume').fill('30'); assert.deepEqual(await page.evaluate(() => JSON.parse(localStorage.getItem('leggenda-regolo-audio'))), { volume: 0.3, muted: false });