Campomigliaio collegato (strada, circolino, ponte), il Poggio verso la Fortezza; Ringraziamenti coi ritratti e il carosello
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ApqNBvNbNCwXqR2RLo8QJh
This commit is contained in:
+11
-4
@@ -5,7 +5,7 @@ import { chromium } from 'playwright';
|
||||
import { spawn } from 'node:child_process';
|
||||
import { mkdirSync, readFileSync } from 'node:fs';
|
||||
import assert from 'node:assert/strict';
|
||||
import { solution } from '../src/story/solution.js';
|
||||
import { solution, route } from '../src/story/solution.js';
|
||||
|
||||
const OUT = process.env.OUT ?? '/tmp/regolo-shots', PORT = 8000 + Math.floor(Math.random() * 900);
|
||||
mkdirSync(OUT, { recursive: true });
|
||||
@@ -64,9 +64,16 @@ try {
|
||||
await page.screenshot({ path: `${OUT}/01-titolo.png` });
|
||||
// I crediti dal titolo: si aprono, mostrano i nomi, Esc li chiude.
|
||||
await page.click('#title .open-credits');
|
||||
assert.match(await page.textContent('#credits'), /Crediti\s*Al Lele/, 'la dedica al Lele viene per prima');
|
||||
assert.match(await page.textContent('#credits'), /Yuri Baldi/);
|
||||
assert.match(await page.textContent('#credits'), /Ringraziamenti\s*Al Lele/, 'la dedica al Lele viene per prima');
|
||||
assert.match(await page.textContent('#credits'), /Baldoria \(Yuri Baldi\)/);
|
||||
assert.match(await page.textContent('#credits'), /Francesco Bacci/);
|
||||
// I nomi col ritratto: si tocca il nome, compare il volto; un altro tocco lo chiude.
|
||||
await page.click('#credits .credit-face >> text=Mariano');
|
||||
assert.ok(await page.isVisible('#face img'));
|
||||
await page.waitForFunction(() => document.querySelector('#face img').naturalWidth > 0, null, { timeout: 5000 });
|
||||
await page.screenshot({ path: `${OUT}/01d-ritratto.png` });
|
||||
await page.click('#face');
|
||||
assert.ok(await page.isHidden('#face'));
|
||||
const onTop = await page.evaluate(() => { const r = document.getElementById('close-credits').getBoundingClientRect();
|
||||
return document.elementFromPoint(r.x + r.width / 2, r.y + r.height / 2)?.id === 'close-credits'; });
|
||||
assert.ok(onTop, 'i crediti stanno sopra il titolo, non dietro');
|
||||
@@ -214,7 +221,7 @@ try {
|
||||
// Una partita a metà riprende da dove era rimasta.
|
||||
await page.click('#restart');
|
||||
await settle(page);
|
||||
for (const exit of ['verso_villa_adami', 'su_villa_adami', 'salita', 'su_fortezza', 'sentiero_trebbio', 'ai_cipressi', 'al_trebbio']) {
|
||||
for (const [, exit] of route('piazza', 'trebbio')) {
|
||||
await clickScene(page, await hotspotCenter(page, exit));
|
||||
await settle(page);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user