Skip to content

Commit 69353dc

Browse files
committed
Take a screenshot at the end of ten gameplay tests
One test per game, for the ones whose result is worth looking at: the tank's target after the shell exploded on it, the target that was shot at in the first person shooter, the car past the finish line, the RTS selection walking to where it was sent, the two 3D boards after a piece was dropped or a tile placed, the RPG scene after the NPC was answered, the first person farming inventory holding the harvested seed, and both platformers once their coins are collected. They are 9 to 17 KB each and the CI already stores them next to the results of the game they belong to. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M2jc7PVAvmMmirAQude2v1
1 parent 312f143 commit 69353dc

11 files changed

Lines changed: 57 additions & 10 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ took with `harness.takeScreenshot(...)` in a `gameplay-test-screenshots/`
8383
folder next to the results — which refer to them by a relative path, so a
8484
downloaded results file still points at the right images.
8585

86+
A handful of tests end with a screenshot of what the game looks like once
87+
the thing they check has happened (the tank's target after the shell
88+
exploded on it, the inventory holding the seed that was harvested, the car
89+
past the finish line with the lap counter at 1...). They are a few kilobytes
90+
each and make a run readable at a glance, so they are worth adding to a test
91+
whose result is something you would want to look at.
92+
8693
The tests of every game can also be run on a branch, without waiting for it to
8794
land on `main`, by triggering a CircleCI pipeline with the
8895
`run-all-gameplay-tests` parameter set to `true`. The number of parallel

examples/starting-3D-platformer/starting-3D-platformer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2764,7 +2764,11 @@
27642764
"harness.assert(",
27652765
" coinIds().length < coinsBefore,",
27662766
" 'The number of coins left in the level went down.'",
2767-
");"
2767+
");",
2768+
"",
2769+
"// A picture of what the game looks like once this has happened, kept with",
2770+
"// the test results.",
2771+
"await harness.takeScreenshot('the player standing where the coin was');"
27682772
]
27692773
}
27702774
],

examples/starting-3d-car-racing/starting-3d-car-racing.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2212,7 +2212,11 @@
22122212
" finalProgress.checkpoint === 1,",
22132213
" 'The next checkpoint to reach is the first one of the new lap (it is ' +",
22142214
" finalProgress.checkpoint + ').'",
2215-
");"
2215+
");",
2216+
"",
2217+
"// A picture of what the game looks like once this has happened, kept with",
2218+
"// the test results.",
2219+
"await harness.takeScreenshot('the car just past the finish line');"
22162220
]
22172221
}
22182222
],

examples/starting-3d-draggable-tiles/starting-3d-draggable-tiles.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,11 @@
13081308
" 'The piece is dropped on the cell it was dragged to (it is at ' +",
13091309
" Math.round(dropped.x) + ',' + Math.round(dropped.y) +",
13101310
" ', expected ' + targetX + ',' + targetY + ').'",
1311-
");"
1311+
");",
1312+
"",
1313+
"// A picture of what the game looks like once this has happened, kept with",
1314+
"// the test results.",
1315+
"await harness.takeScreenshot('the board with the piece dropped on its new cell');"
13121316
]
13131317
},
13141318
{

examples/starting-3d-rts-unit-selection/starting-3d-rts-unit-selection.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,11 @@
17711771
" unitsThatMoved === positionsBeforeOrder.size,",
17721772
" 'Every unit of the selection walks to where the group was ordered (' +",
17731773
" unitsThatMoved + ' of ' + positionsBeforeOrder.size + ' moved).'",
1774-
");"
1774+
");",
1775+
"",
1776+
"// A picture of what the game looks like once this has happened, kept with",
1777+
"// the test results.",
1778+
"await harness.takeScreenshot('the whole selection walking to where it was sent');"
17751779
]
17761780
}
17771781
],

examples/starting-3d-tank/starting-3d-tank.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2472,7 +2472,11 @@
24722472
"harness.assert(",
24732473
" blownAway,",
24742474
" 'The explosion blows the target away (it moved ' + Math.round(knockback) + 'px).'",
2475-
");"
2475+
");",
2476+
"",
2477+
"// A picture of what the game looks like once this has happened, kept with",
2478+
"// the test results.",
2479+
"await harness.takeScreenshot('the target after the shell exploded on it');"
24762480
]
24772481
}
24782482
],

examples/starting-3d-tile-placement/starting-3d-tile-placement.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,11 @@
16471647
" placedTiles() === 1,",
16481648
" 'Clicking a cell that already holds a tile does not place another one (' +",
16491649
" placedTiles() + ' tiles on the board).'",
1650-
");"
1650+
");",
1651+
"",
1652+
"// A picture of what the game looks like once this has happened, kept with",
1653+
"// the test results.",
1654+
"await harness.takeScreenshot('the board with the tile placed on it');"
16511655
]
16521656
}
16531657
],

examples/starting-first-person-farming/starting-first-person-farming.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6511,7 +6511,11 @@
65116511
" getPlayer().rotationY > 2,",
65126512
" 'The view really had to be lowered onto the patch (it ended at ' +",
65136513
" getPlayer().rotationY.toFixed(1) + ' degrees).'",
6514-
");"
6514+
");",
6515+
"",
6516+
"// A picture of what the game looks like once this has happened, kept with",
6517+
"// the test results.",
6518+
"await harness.takeScreenshot('the inventory holding the seed that was harvested');"
65156519
]
65166520
}
65176521
],

examples/starting-first-person-shooter/starting-first-person-shooter.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2831,7 +2831,11 @@
28312831
"harness.assert(",
28322832
" knockedOver,",
28332833
" 'Being shot knocks the target over (it moved ' + pushed.toFixed(1) + ' units).'",
2834-
");"
2834+
");",
2835+
"",
2836+
"// A picture of what the game looks like once this has happened, kept with",
2837+
"// the test results.",
2838+
"await harness.takeScreenshot('the target that was shot at');"
28352839
]
28362840
}
28372841
],

examples/starting-platformer/starting-platformer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,11 @@
12921292
"harness.assert(",
12931293
" remaining.length === coinsBefore - targetIds.length,",
12941294
" 'Only the coins the player ran into were collected.'",
1295-
");"
1295+
");",
1296+
"",
1297+
"// A picture of what the game looks like once this has happened, kept with",
1298+
"// the test results.",
1299+
"await harness.takeScreenshot('the level once every coin has been collected');"
12961300
]
12971301
}
12981302
],

0 commit comments

Comments
 (0)