diff --git a/examples/starting-3d-point-and-click-adventure/starting-3d-point-and-click-adventure.json b/examples/starting-3d-point-and-click-adventure/starting-3d-point-and-click-adventure.json index 522ef2806..f6592dd85 100644 --- a/examples/starting-3d-point-and-click-adventure/starting-3d-point-and-click-adventure.json +++ b/examples/starting-3d-point-and-click-adventure/starting-3d-point-and-click-adventure.json @@ -1858,7 +1858,11 @@ " !harness.getObjects('NPC').some((one) => one.id === npc.id),", " 'The NPC that was talked to is the one that left.'", ");", - "harness.assert(!isDialogOpen(), 'The dialog closes once it is answered.');" + "harness.assert(!isDialogOpen(), 'The dialog closes once it is answered.');", + "", + "// A picture of what the game looks like once this has happened, kept with", + "// the test results.", + "await harness.takeScreenshot('the scene after the NPC agreed to leave');" ] } ], diff --git a/examples/starting-beatemup/starting-beatemup.json b/examples/starting-beatemup/starting-beatemup.json index 17bb40705..8874f1877 100644 --- a/examples/starting-beatemup/starting-beatemup.json +++ b/examples/starting-beatemup/starting-beatemup.json @@ -2274,7 +2274,11 @@ " knockback > 5,", " 'The enemy is knocked back away from the player (it moved ' +", " Math.round(knockback) + 'px).'", - ");" + ");", + "", + "// A picture of what the game looks like once this has happened, kept with", + "// the test results.", + "await harness.takeScreenshot('the enemy taking the hit');" ] }, { diff --git a/examples/starting-card-game/starting-card-game.json b/examples/starting-card-game/starting-card-game.json index 6b13da1a7..aa4b5f49d 100644 --- a/examples/starting-card-game/starting-card-game.json +++ b/examples/starting-card-game/starting-card-game.json @@ -3164,7 +3164,11 @@ " stillOnDeck[0].centerY - deck.centerY", " ) < 40,", " 'The new card is on the deck.'", - ");" + ");", + "", + "// A picture of what the game looks like once this has happened, kept with", + "// the test results.", + "await harness.takeScreenshot('the card that was drawn, in front of the deck');" ] }, { diff --git a/examples/starting-first-person-survival-crafting/starting-first-person-survival-crafting.json b/examples/starting-first-person-survival-crafting/starting-first-person-survival-crafting.json index 1054d1454..bd9a7c58c 100644 --- a/examples/starting-first-person-survival-crafting/starting-first-person-survival-crafting.json +++ b/examples/starting-first-person-survival-crafting/starting-first-person-survival-crafting.json @@ -4840,7 +4840,11 @@ " harvested,", " 'Acting on the tree puts a log in the inventory (it holds ' +", " JSON.stringify(filledSlots()) + ').'", - ");" + ");", + "", + "// A picture of what the game looks like once this has happened, kept with", + "// the test results.", + "await harness.takeScreenshot('the inventory holding the log that was harvested');" ] } ], diff --git a/examples/starting-point-and-click-adventure/starting-point-and-click-adventure.json b/examples/starting-point-and-click-adventure/starting-point-and-click-adventure.json index fe666c861..26cff557b 100644 --- a/examples/starting-point-and-click-adventure/starting-point-and-click-adventure.json +++ b/examples/starting-point-and-click-adventure/starting-point-and-click-adventure.json @@ -1337,20 +1337,10 @@ " await harness.stepFrames(3);", "};", "", - "/**", - " * Close the dialog if one is open. The game opens one straight away: the", - " * player is spawned overlapping two NPCs, and an NPC counts as \"being talked", - " * to\" by default (see the feedback document), so the level starts with the", - " * dialog up and the player frozen. Saying \"no\" is how a player gets out of", - " * it, and it leaves the game in the state the rest of the test needs.", - " */", "await harness.stepFrames(3);", - "if (isDialogOpen()) {", - " const dialog = harness.getObjects('TwoChoicesDialogBox')[0];", - " const no = dialog.children.NoButton[0];", - " await clickAt(no.centerX, no.centerY, no.layer);", - "}", - "harness.assert(!isDialogOpen(), 'No dialog is in the way.');", + "// The level starts with nobody being talked to, so the player is free to", + "// walk from the first frame.", + "harness.assert(!isDialogOpen(), 'No dialog is in the way when the level starts.');", "", "// Nothing happens on its own: the player only walks when told to.", "const start = getPlayer();", @@ -1457,23 +1447,18 @@ " await harness.stepFrames(3);", "};", "", - "// The level starts with a dialog already up (the player is spawned", - "// overlapping two NPCs, and an NPC counts as \"being talked to\" by default —", - "// see the feedback document). Say no to it, which is how a player gets out.", "await harness.stepFrames(3);", - "if (isDialogOpen()) {", - " const no = getDialog().children.NoButton[0];", - " await clickAt(no.centerX, no.centerY, no.layer);", - "}", - "harness.assert(!isDialogOpen(), 'No dialog is in the way to begin with.');", + "// Nobody is being talked to when the level starts: the dialog below can only", + "// come from the click.", + "harness.assert(!isDialogOpen(), 'No dialog is open before talking to anyone.');", "", "const npcsBefore = harness.getObjects('NPC').length;", "harness.assert(npcsBefore > 0, 'There are NPCs to talk to.');", "", - "// Click on an NPC standing where the player is: clicking is what picks the", - "// NPC to talk to, and being next to it is what opens the dialog. One of the", - "// NPCs the player spawns on is used, so that the dialog depends on the click", - "// and not on a walk across the level.", + "// Click on an NPC the player is standing next to: clicking is what picks the", + "// NPC to talk to, and being next to it is what opens the dialog. The player", + "// is wide enough to touch two of the NPCs from where it spawns, so one of", + "// those is used and the dialog depends on the click alone.", "const player = getPlayer();", "const isWithinReach = (npc) =>", " Math.abs(npc.centerX - player.centerX) < (npc.width + player.width) / 2 &&", @@ -1514,7 +1499,11 @@ " !harness.getObjects('NPC').some((one) => one.id === npc.id),", " 'The NPC that was talked to is the one that left.'", ");", - "harness.assert(!isDialogOpen(), 'The dialog closes once it is answered.');" + "harness.assert(!isDialogOpen(), 'The dialog closes once it is answered.');", + "", + "// A picture of what the game looks like once this has happened, kept with", + "// the test results.", + "await harness.takeScreenshot('the scene after the NPC agreed to leave');" ] } ],