Add post-battle camp scene
This commit is contained in:
@@ -139,6 +139,28 @@ try {
|
||||
|
||||
await page.screenshot({ path: 'dist/verification-battle-result-victory.png', fullPage: true });
|
||||
|
||||
await page.mouse.click(738, 642);
|
||||
await page.waitForFunction(() => {
|
||||
const activeScenes = window.__HEROS_DEBUG__?.activeScenes() ?? [];
|
||||
return activeScenes.includes('CampScene');
|
||||
});
|
||||
await page.screenshot({ path: 'dist/verification-camp.png', fullPage: true });
|
||||
|
||||
const campState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||
if (!campState || campState.scene !== 'CampScene' || campState.report?.rewardGold <= 0) {
|
||||
throw new Error(`Expected CampScene report after victory: ${JSON.stringify(campState)}`);
|
||||
}
|
||||
|
||||
await page.mouse.click(830, 38);
|
||||
await page.waitForTimeout(120);
|
||||
await page.mouse.click(974, 482);
|
||||
await page.waitForTimeout(260);
|
||||
|
||||
const campStateAfterDialogue = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
|
||||
if (!campStateAfterDialogue.report?.completedCampDialogues?.length) {
|
||||
throw new Error(`Expected camp dialogue to award bond exp: ${JSON.stringify(campStateAfterDialogue)}`);
|
||||
}
|
||||
|
||||
await page.evaluate(() => window.__HEROS_DEBUG__?.goToBattle());
|
||||
await page.waitForFunction(() => {
|
||||
const state = window.__HEROS_DEBUG__?.battle();
|
||||
|
||||
Reference in New Issue
Block a user