Texture fill e2e checks pick the right image in a full run (#186)
game-maker / gate (push) Successful in 2m19s
game-maker / suite (push) Successful in 8m5s

CI run 217 for 592ea94 failed three checks in block 47i. In the full
run the texture list is longer than in a single module run, so the
picker click missed "halves" and the texture stayed empty.

- The check now types "halves" into the menu search field and picks
  it with Enter, independent of the list length.
- FIND_HALVES looks the image up by name. Matching only by size had
  picked the 32 px image "wedge" in the full run.
- The texture fill check forces a redraw before reading pixels. After
  the work of earlier modules the vector tab does not redraw once the
  texture has loaded. That bug is tracked in #196, and the forced
  redraw goes away with it.

Tests:
- ./check.sh: CHECK EXIT 0
- npm run build: BUILD EXIT 0
- GM_STEPS=47 (fresh seed): ALL PASSED, 54 checks
- Full run not repeated locally. CI decides.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5 committed 2026-09-21 14:59:06 +02:00
1 parent 592ea942d9
commit 1c8a20fcac
2 files changed
+23 -7

No files matched your search

+17 -5
View File
@@ -832,23 +832,35 @@ export async function vectorArt(t) {
const halvesName = await json(
`__gm.state.project.assets.find((a) => a.id === ${JSON.stringify(halves?.id ?? '')})?.name ?? null`,
);
const halvesEntry = halvesName && (await inOverlay(halvesName));
if (halvesEntry) await click(halvesEntry.x, halvesEntry.y);
else await press('Escape');
// Picked through the search box: after the earlier modules the list holds 30-odd pictures, and
// an entry below the fold of the capped menu cannot be clicked. Enter takes the first match; a
// click would hit the typed name in the search box first.
if (halvesName) {
await typeText(halvesName);
await settle();
}
const filteredOffers = (await json('__gm.menuRows()')) ?? [];
const halvesEntry = Boolean(halvesName) && filteredOffers.includes(halvesName);
await press(halvesEntry ? 'Enter' : 'Escape');
await settle();
// The picture loads asynchronously and the shape keeps its plain fill until it is there. In the
// full run the tab then waits for the next redraw instead of drawing when the picture lands
// (#196), so the check asks for that redraw itself. Remove the preview() with #196.
await sleep(300);
await evaluate('__gm.state.preview()');
await settle();
const tiled = (await sky())?.paint;
const leftHalf = await tabPixel(60, 100);
const rightHalf = await tabPixel(196, 100);
check(
'Texture offers the uploaded pictures but no drawing, and fills the shape with the one picked',
Boolean(halvesEntry) &&
halvesEntry &&
!pictureOffers.includes('Emblem') &&
tiled?.type === 'texture' &&
tiled.texture === halves?.id &&
colourDistance(leftHalf, HALVES_LEFT) < 20 &&
colourDistance(rightHalf, HALVES_RIGHT) < 20,
JSON.stringify({ pictureOffers, tiled, leftHalf, rightHalf }),
JSON.stringify({ filteredOffers, tiled, leftHalf, rightHalf }),
);
const tileCorner = await screenAt(228, 228);