Add city gameplay, snapshot migrations, administration and Compose operations

This commit is contained in:
mrleo1nid committed 2026-10-30 22:17:17 +03:00
1 parent 3b1fcd996a
commit 85df37c26e
24 files changed
+1042 -55

No files matched your search

+14
View File
@@ -24,6 +24,10 @@ try {
await page.waitForFunction(()=>document.querySelector('.viewer-top [role=status]')?.textContent.includes('в загруженной области'),null,{timeout:60000});
const visibleMs=Math.round(performance.now()-started);
await page.waitForFunction(()=>document.querySelector('.room-clock')?.textContent.includes('День'),null,{timeout:10000});
await page.waitForFunction(()=>document.querySelector('.room-gameplay')?.textContent.includes('Казна'),null,{timeout:10000});
await page.locator('[data-action=meal]').click();
await page.waitForFunction(()=>document.querySelector('[data-action=meal]')?.disabled,null,{timeout:5000});
await page.waitForFunction(()=>document.querySelector('.room-gameplay')?.textContent.includes('Общий обед'),null,{timeout:15000});
await page.getByRole('button',{name:'Пауза',exact:true}).click();
await page.waitForFunction(()=>document.querySelector('.room-clock')?.textContent.includes('×0'),null,{timeout:10000});
await page.getByRole('button',{name:'1',exact:true}).click();
@@ -31,4 +35,14 @@ try {
await mkdir('.tools',{recursive:true}); await page.screenshot({path:'.tools/browser-room.png'});
assert.deepEqual(errors,[]);
console.log(JSON.stringify({ui:'passed',visibleMs,status:await page.locator('.viewer-top').innerText(),screenshot:resolve('.tools/browser-room.png')}));
if (process.env.CITYGEN_TEST_ADMIN_TOKEN) {
await page.goto(`${base}/?admin`);
await page.getByLabel('Токен оператора').fill(process.env.CITYGEN_TEST_ADMIN_TOKEN);
await page.getByRole('button',{name:'Обновить',exact:true}).click();
await page.waitForFunction(()=>document.querySelector('[role=status]')?.textContent.includes('МиБ'),null,{timeout:10000});
const saved = page.waitForResponse(r=>r.url().endsWith('/checkpoint') && r.request().method()==='POST');
await page.getByRole('button',{name:'Сохранить',exact:true}).first().click();
assert.equal((await saved).status(),200);
console.log(JSON.stringify({admin:'passed'}));
}
} finally {await browser.close();}