test: follow exact prologue checkpoint resumes
This commit is contained in:
@@ -41,7 +41,15 @@ try {
|
|||||||
await waitForTitle(page);
|
await waitForTitle(page);
|
||||||
await assertDesktopViewport(page);
|
await assertDesktopViewport(page);
|
||||||
await verifyReducedMotionExploration(page);
|
await verifyReducedMotionExploration(page);
|
||||||
await page.evaluate(() => window.localStorage.clear());
|
await page.addInitScript(() => {
|
||||||
|
const marker =
|
||||||
|
'heros-web:qa:prologue-village-clean-start';
|
||||||
|
if (window.sessionStorage.getItem(marker) === '1') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.localStorage.clear();
|
||||||
|
window.sessionStorage.setItem(marker, '1');
|
||||||
|
});
|
||||||
await page.reload({ waitUntil: 'domcontentloaded', timeout: 90000 });
|
await page.reload({ waitUntil: 'domcontentloaded', timeout: 90000 });
|
||||||
await waitForDebugApi(page);
|
await waitForDebugApi(page);
|
||||||
await waitForTitle(page);
|
await waitForTitle(page);
|
||||||
@@ -505,6 +513,8 @@ try {
|
|||||||
'Militia camp arrival must not retrigger dialogue on a later update.'
|
'Militia camp arrival must not retrigger dialogue on a later update.'
|
||||||
);
|
);
|
||||||
await advanceMilitiaCampDialogueUntilClosed(page);
|
await advanceMilitiaCampDialogueUntilClosed(page);
|
||||||
|
const campPlayerBeforeReload =
|
||||||
|
(await readMilitiaCamp(page)).player;
|
||||||
|
|
||||||
await page.reload({ waitUntil: 'domcontentloaded', timeout: 90000 });
|
await page.reload({ waitUntil: 'domcontentloaded', timeout: 90000 });
|
||||||
await waitForDebugApi(page);
|
await waitForDebugApi(page);
|
||||||
@@ -520,19 +530,38 @@ try {
|
|||||||
false,
|
false,
|
||||||
'The pointer-route smoke reload must not replay the one-time camp introduction.'
|
'The pointer-route smoke reload must not replay the one-time camp introduction.'
|
||||||
);
|
);
|
||||||
|
assert(
|
||||||
|
Math.abs(
|
||||||
|
militiaCamp.player.x - campPlayerBeforeReload.x
|
||||||
|
) <= 1 &&
|
||||||
|
Math.abs(
|
||||||
|
militiaCamp.player.y - campPlayerBeforeReload.y
|
||||||
|
) <= 1 &&
|
||||||
|
militiaCamp.player.direction ===
|
||||||
|
campPlayerBeforeReload.direction,
|
||||||
|
`The militia checkpoint must restore the exact player position and direction: ${JSON.stringify(
|
||||||
|
{
|
||||||
|
before: campPlayerBeforeReload,
|
||||||
|
after: militiaCamp.player
|
||||||
|
}
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
|
||||||
const campPlayerBeforeMove = militiaCamp.player;
|
const campPlayerBeforeMove = militiaCamp.player;
|
||||||
await page.keyboard.down('ArrowUp');
|
|
||||||
await page.waitForTimeout(360);
|
|
||||||
await page.keyboard.up('ArrowUp');
|
|
||||||
await page.keyboard.down('ArrowLeft');
|
await page.keyboard.down('ArrowLeft');
|
||||||
await page.waitForTimeout(980);
|
await page.waitForTimeout(800);
|
||||||
|
await page.keyboard.up('ArrowLeft');
|
||||||
|
await page.keyboard.down('ArrowDown');
|
||||||
|
await page.waitForTimeout(1100);
|
||||||
|
await page.keyboard.up('ArrowDown');
|
||||||
|
await page.keyboard.down('ArrowLeft');
|
||||||
|
await page.waitForTimeout(350);
|
||||||
await page.keyboard.up('ArrowLeft');
|
await page.keyboard.up('ArrowLeft');
|
||||||
await page.waitForTimeout(80);
|
await page.waitForTimeout(80);
|
||||||
const campAfterMove = await readMilitiaCamp(page);
|
const campAfterMove = await readMilitiaCamp(page);
|
||||||
assert(
|
assert(
|
||||||
campPlayerBeforeMove.y - campAfterMove.player.y >= 70 &&
|
campAfterMove.player.y - campPlayerBeforeMove.y >= 270 &&
|
||||||
campPlayerBeforeMove.x - campAfterMove.player.x >= 220,
|
campPlayerBeforeMove.x - campAfterMove.player.x >= 270,
|
||||||
`Expected keyboard traversal through the militia camp: ${JSON.stringify({
|
`Expected keyboard traversal through the militia camp: ${JSON.stringify({
|
||||||
before: campPlayerBeforeMove,
|
before: campPlayerBeforeMove,
|
||||||
after: campAfterMove.player
|
after: campAfterMove.player
|
||||||
|
|||||||
Reference in New Issue
Block a user