Telefono in orizzontale: verbi e pausa dentro lo schermo, con un controllo nella prova nel browser
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017egeN2amL84ErjfgQFtEDn
This commit is contained in:
@@ -179,6 +179,19 @@ try {
|
||||
assert.ok(await phone.evaluate(() => [...document.querySelectorAll('#verbs button')].every(b => b.scrollWidth <= b.clientWidth + 1 && b.getBoundingClientRect().right <= innerWidth)), 'verbi tagliati sul telefono');
|
||||
assert.equal(overflow, false, 'scorrimento orizzontale su telefono');
|
||||
await phone.screenshot({ path: `${OUT}/08-telefono.png` });
|
||||
// Telefono stretto in orizzontale: niente deve allargare la pagina oltre lo schermo (il browser la rimpicciolirebbe
|
||||
// e taglierebbe verbi e inventario a destra), e la pausa sta tutta dentro la scena.
|
||||
const small = await browser.newPage({ viewport: { width: 740, height: 330 }, deviceScaleFactor: 2.4, hasTouch: true, isMobile: true });
|
||||
small.on('pageerror', e => errors.push(e.message));
|
||||
await small.goto(`http://127.0.0.1:${PORT}/`);
|
||||
await small.waitForSelector('#splash', { state: 'hidden', timeout: 15000 });
|
||||
await small.click('#new-game');
|
||||
await small.click('#skip-intro');
|
||||
await settle(small);
|
||||
assert.equal(await small.evaluate(() => innerWidth), 740, 'la pagina è più larga dello schermo del telefono');
|
||||
await small.click('#pause-button');
|
||||
assert.ok(await small.evaluate(() => document.getElementById('to-title').getBoundingClientRect().bottom <= document.getElementById('stage').getBoundingClientRect().bottom), 'la pausa esce dalla scena');
|
||||
await small.screenshot({ path: `${OUT}/08b-telefono-stretto-pausa.png` });
|
||||
const landscape = await open({ width: 844, height: 390 });
|
||||
await landscape.click('#new-game');
|
||||
await landscape.click('#skip-intro');
|
||||
|
||||
Reference in New Issue
Block a user