Il risveglio di nuovo come prima sul computer, con la sfocatura vera, e leggero sul telefono, senza filtri; tutte e due su una tela a parte che c'è solo finché il risveglio dura, così la scena non ne risente (Andrea)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiECd9RWGMKV7n3K1mdy8T
This commit is contained in:
2026-10-31 11:57:26 +01:00
co-authored by Claude Opus 5.5
parent f7ca286066
commit f57a91ca74
5 changed files with 56 additions and 25 deletions
+2 -1
View File
@@ -398,8 +398,9 @@ try {
assert.equal(await book.evaluate(() => game.closeup.step), 'turn', 'un altro gira la pagina');
await book.waitForFunction(() => game.closeup?.step === 'end');
assert.equal(await book.evaluate(() => game.speech), null, '«FINE» non lo dice nessuno');
await book.screenshot({ path: `${OUT}/03b-libro-fine.png` });
// Prima la battuta, poi la schermata: con swiftshader una schermata può durare più della battuta.
await book.waitForFunction(() => game.speech?.text === 'Mi ricordavo un finale diverso.', null, { timeout: 5000 });
await book.screenshot({ path: `${OUT}/03b-libro-fine.png` });
assert.deepEqual(await book.evaluate(() => [game.state.x, game.state.y]), where, 'i clic sul libro non muovono Andrea');
await book.keyboard.press('Space');
await book.keyboard.press('Escape');
+8 -3
View File
@@ -12,7 +12,10 @@ let browser;
const errors = [];
try {
browser = await chromium.launch({ args: ['--autoplay-policy=no-user-gesture-required', '--use-gl=angle', '--use-angle=swiftshader', '--enable-unsafe-swiftshader'] });
const page = await browser.newPage({ viewport: { width: 1280, height: 860 } });
// Sul computer la versione con la sfocatura vera, sul telefono (touch) quella leggera senza filtri.
for (const mobile of [false, true]) {
const page = await browser.newPage(mobile ? { viewport: { width: 844, height: 390 }, hasTouch: true, isMobile: true } : { viewport: { width: 1280, height: 860 } });
const tag = mobile ? 'telefono' : 'computer';
page.on('pageerror', e => { errors.push(e.message); console.log('ERR', e.message); });
await page.goto(`http://127.0.0.1:${server.port}/`);
await page.click('#splash'); await page.click('#new-game'); await page.click('#rione [data-rione="campomigliaio"]'); await page.click('#skip-intro');
@@ -21,10 +24,12 @@ try {
// Le battute si saltano solo per far correre il tempo fino ai momenti da fotografare.
for (const [t, name] of [[0.5, '0-buio'], [2.1, '1-primo-tentativo'], [3.8, '2-secondo'], [5.6, '3-quasi'], [7.2, '4-aperti']]) {
await page.waitForFunction(at => { if (game.speech && game.closeup) game.skip(); return !game.closeup || game.closeup.t >= at; }, t, { timeout: 30000, polling: 50 });
await page.screenshot({ path: `${out}/${name}.png` });
await page.screenshot({ path: `${out}/${tag}-${name}.png` });
}
await page.waitForFunction(() => !game.closeup && game.state.flags.intro, null, { timeout: 15000 });
await page.screenshot({ path: `${out}/5-vecchietti.png` });
await page.screenshot({ path: `${out}/${tag}-5-vecchietti.png` });
assert.equal(await page.locator('#risveglio').count(), 0, 'finito il risveglio, la sua tela se ne va');
}
assert.deepEqual(errors, []);
console.log(`ok: schermate in ${out}`);
} finally { await browser?.close(); server.kill(); }