Verify final camp routes to ending
This commit is contained in:
@@ -279,11 +279,18 @@ try {
|
|||||||
await waitForCamp(page);
|
await waitForCamp(page);
|
||||||
const finalCampState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
const finalCampState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||||
assert(finalCampState?.campaign?.step === 'sixty-sixth-camp', `Expected final camp save to continue: ${JSON.stringify(finalCampState)}`);
|
assert(finalCampState?.campaign?.step === 'sixty-sixth-camp', `Expected final camp save to continue: ${JSON.stringify(finalCampState)}`);
|
||||||
|
assert(finalCampState.sortieHasBattle === false, `Expected final camp to expose no playable sortie target: ${JSON.stringify(finalCampState)}`);
|
||||||
|
assert(finalCampState.nextSortieBattleId === null, `Expected final camp to route to ending instead of a battle: ${JSON.stringify(finalCampState)}`);
|
||||||
|
assert(
|
||||||
|
Array.isArray(finalCampState.sortieDeploymentPreview) && finalCampState.sortieDeploymentPreview.length === 0,
|
||||||
|
`Expected final camp deployment preview to stay empty: ${JSON.stringify(finalCampState?.sortieDeploymentPreview)}`
|
||||||
|
);
|
||||||
await page.screenshot({ path: `${screenshotDir}/rc-final-camp.png`, fullPage: true });
|
await page.screenshot({ path: `${screenshotDir}/rc-final-camp.png`, fullPage: true });
|
||||||
await assertCanvasPainted(page, 'final camp');
|
await assertCanvasPainted(page, 'final camp');
|
||||||
|
|
||||||
await page.mouse.click(1160, 38);
|
await page.mouse.click(1160, 38);
|
||||||
const finalTransitionScenes = await waitForStoryOrEnding(page);
|
const finalTransitionScenes = await waitForStoryOrEnding(page);
|
||||||
|
assert(!finalTransitionScenes.includes('BattleScene'), `Expected final camp transition to avoid BattleScene: ${JSON.stringify(finalTransitionScenes)}`);
|
||||||
if (finalTransitionScenes.includes('StoryScene')) {
|
if (finalTransitionScenes.includes('StoryScene')) {
|
||||||
await waitForStoryReady(page);
|
await waitForStoryReady(page);
|
||||||
await advanceStoryUntilEnding(page);
|
await advanceStoryUntilEnding(page);
|
||||||
|
|||||||
Reference in New Issue
Block a user