diff --git a/tools/smoke-actor.mjs b/tools/smoke-actor.mjs index 00caa6ae..5608eb95 100644 --- a/tools/smoke-actor.mjs +++ b/tools/smoke-actor.mjs @@ -104,20 +104,24 @@ await runChecks({ projectId, baseUrl, port: 9341, shotPrefix: 'gm-actor' }, asyn // 5. Walking right, and stopping on the standing frame of the way he faces. await keyDown('d'); await sleep(400); - const walking = await entity('oplayer'); await shot('03-walk-right'); + const walking = await entity('oplayer'); await keyUp('d'); await sleep(250); const stopped = await entity('oplayer'); + await sleep(150); + const still = await entity('oplayer'); check( 'holding D walks right and plays the right walk animation', walking.x > 30 && walking.props.texture === 'walk-right', JSON.stringify({ x: Math.round(walking.x), texture: walking.props.texture }), ); + // Two samples after the release: he must not move between them. Comparing against the walking + // sample measured how long the screenshot took (22 to 40 px on the CI runner), not the stop. check( 'letting go stops him on the standing frame of the way he faces', - stopped.props.texture === IDLE.right && Math.abs(stopped.x - walking.x) < 40, - JSON.stringify({ x: Math.round(stopped.x), texture: stopped.props.texture }), + stopped.props.texture === IDLE.right && Math.abs(still.x - stopped.x) < 1 && stopped.x > walking.x - 1, + JSON.stringify({ x: Math.round(stopped.x), later: Math.round(still.x), texture: stopped.props.texture }), ); // 6. Walking up is −y.