From 4cf71d729d3d93d4af2de85db6d5d54f95169f62 Mon Sep 17 00:00:00 2001 From: Douwe de Vries Date: Sat, 14 Nov 2026 18:28:48 +0100 Subject: [PATCH] Stabilize Hauler selection in the browser gameplay check --- tools/web_tests/game.spec.cjs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tools/web_tests/game.spec.cjs b/tools/web_tests/game.spec.cjs index f46202ff..1a5126f9 100644 --- a/tools/web_tests/game.spec.cjs +++ b/tools/web_tests/game.spec.cjs @@ -73,7 +73,6 @@ test('release starts on WebGL2 and uses real menu input', async ({ page }, info) test('worker orders construction production and saves survive reload', async ({ page }, info) => { // Three simulation waits plus two launches need a bounded software-rendering budget. test.setTimeout(480000); - test.setTimeout(240000); await page.addInitScript(captureAudio); await boot(page, 'http://127.0.0.1:8071/?mission=conquest'); await expect.poll(async () => (await state(page))?.mission).toBe('conquest'); @@ -101,16 +100,14 @@ test('worker orders construction production and saves survive reload', async ({ await expect.poll(async () => (await state(page)).buildings.some(b => b.kind === 'concord_reactor' && !b.constructing), { timeout: 90000 }).toBe(true); await page.keyboard.press('Escape'); await button(page, 'RESUME'); - // Clear the construction worker from the hauling route before picking the Hauler. - // Their selection spheres can overlap after a long software-rendered build. - await page.mouse.click(...(await state(page)).ground[1], { delay: 80 }); - await expect.poll(async () => { - const current = await state(page); - const builder = current.units.find(u => u.id === worker.id); - const hauler = current.units.find(u => u.kind === 'concord_hauler'); - return Math.hypot(builder.position[0] - hauler.position[0], builder.position[2] - hauler.position[2]); - }).toBeGreaterThan(6); - const hauler = await entity(page, 'units', u => u.kind === 'concord_hauler'); + const hauler = (await state(page)).units.find(u => u.kind === 'concord_hauler'); + expect(hauler, 'Hauler target').toBeTruthy(); + // Box-select the base crew across the Hauler's whole route, rather than an + // ageing point sample. The rectangle stays clear of tutorial and command UI. + await page.mouse.move(1020, 510); + await page.mouse.down(); + await page.mouse.move(310, 205, { steps: 8 }); + await page.mouse.up(); await expect.poll(async () => (await state(page)).selected).toContain(hauler.id); const deposit = (await state(page)).deposits.find(d => d.remaining > 0 && d.pixel[0] > 850 && d.pixel[0] < 1100 && d.pixel[1] > 200); await page.mouse.click(...deposit.pixel);