← back to Games Agentabrams
Fix stale e2e: decouple cube checks from list order (deep-link) + wait for window.__cube — 7/7 green
f4e6a870cea080b49ef28cedb7ac146d0d7f03c1 · 2026-07-24 19:23:47 -0700 · Steve Abrams
Files touched
Diff
commit f4e6a870cea080b49ef28cedb7ac146d0d7f03c1
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Fri Jul 24 19:23:47 2026 -0700
Fix stale e2e: decouple cube checks from list order (deep-link) + wait for window.__cube — 7/7 green
---
tests/e2e.mjs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/e2e.mjs b/tests/e2e.mjs
index d1952ee..f6c745a 100644
--- a/tests/e2e.mjs
+++ b/tests/e2e.mjs
@@ -41,15 +41,20 @@ const check = (name, ok) => { results.push({ name, ok }); console.log((ok ? 'PAS
await page.goto(url);
await page.waitForSelector('.game');
check('game list renders from manifest', await page.locator('.game').count() >= 1);
-check('AbramsCube.aa listed', (await page.locator('.game .fname').first().textContent()) === 'AbramsCube.aa');
+check('AbramsCube.aa listed', (await page.locator('.game .fname').allTextContents()).includes('AbramsCube.aa'));
check('first game auto-selected', await page.locator('.game.active').count() === 1);
+// Deep-link to the cube so the cube-specific checks are order-independent
+// (the hub lists newest-first, so the cube is no longer the first game).
+await page.goto(url + '#rubiks-cube');
+await page.waitForSelector('.game.active');
const frame = page.frameLocator('#frame');
await frame.locator('#scramble').waitFor({ timeout: 15000 });
check('game iframe loads the cube', await frame.locator('.cubie').count() === 26);
// game is actually playable inside the frame
-const gameFrame = page.frames().find(f => f.url().includes('rubiks-cube'));
+const gameFrame = await (await page.$('#frame')).contentFrame();
+await gameFrame.waitForFunction(() => window.__cube && !window.__cube.isBusy());
await gameFrame.evaluate(() => window.__cube.enqueue('U'));
await gameFrame.waitForFunction(() => !window.__cube.isBusy());
check('cube playable inside hub', (await gameFrame.evaluate(() => window.__cube.getMoves())) === 1);
← 94a2079 Add 8 new arcade games: Asteroids, Minesweeper, Simon, Conne
·
back to Games Agentabrams
·
auto-save: 2026-07-24T20:29:36 (10 files) — games/chomp/ gam 423a750 →