feat: v0.14.0 — ISS-006 time-scale slider values up to 1000x; tests use fastest time
CI / build + unit + e2e (pull_request) Failing after 4m52s
CI / build + unit + e2e (pull_request) Failing after 4m52s
This commit is contained in:
+7
-7
@@ -3,12 +3,12 @@ import { expect, test } from '@playwright/test';
|
||||
|
||||
// v0.12.0 package model against the live origin (https://flight.dev.kkhost.pl):
|
||||
// the full core loop through the UI — hook creates a short package at EDDF → Load
|
||||
// via the right pane → click its destination in the on-board list → fly at 60× →
|
||||
// via the right pane → click its destination in the on-board list → fly at 1000× →
|
||||
// arrival delivers EXACTLY the reward + rep; abandon deducts exactly the formula
|
||||
// penalty while grounded; expired packages deliver/abandon with no reward and no
|
||||
// penalty. Mirrors lib/game/penalty.ts for exact-value assertions.
|
||||
|
||||
const SCALE = 60; // fastest sim speed — keeps flights to seconds of real time
|
||||
const SCALE = 1000; // fastest sim speed (v0.14.0 ladder top) — keeps flights to seconds of real time
|
||||
const HUB = 'EDDF'; // Frankfurt Main — the seeded starter plane's home base (lib/game/seed.ts)
|
||||
const FAR = 'LEZL'; // Seville — one-way burn 3174 L > half tank, so the return leg is unfuelable
|
||||
|
||||
@@ -93,7 +93,7 @@ async function flyHomeViaApi(page: Page): Promise<void> {
|
||||
const s0 = await getState(page);
|
||||
const plane = s0.planes.find((p) => p.id === 'plane-starter')!;
|
||||
if (plane.status === 'flying' || plane.locationIcao !== HUB) {
|
||||
// Fast-forward any leftover leg / repositioning flight (~3 min real time worst case at 60×).
|
||||
// Fast-forward any leftover leg / repositioning flight (~20 s real time worst case at 1000×).
|
||||
await setScale(page, SCALE);
|
||||
}
|
||||
if (plane.status === 'flying') {
|
||||
@@ -119,7 +119,7 @@ async function flyHomeViaApi(page: Page): Promise<void> {
|
||||
|
||||
|
||||
test('full core loop via UI: load → fly to destination → exact reward + rep on arrival', async ({ page }) => {
|
||||
test.setTimeout(300_000); // self-heal (worst case ~3 min at 60×) + two short flights + refuel
|
||||
test.setTimeout(300_000); // self-heal (worst case ~20 s at 1000×) + two short flights + refuel
|
||||
// Self-heal: the starter plane may be anywhere from a previous run/spec.
|
||||
await flyHomeViaApi(page);
|
||||
const before = await getState(page);
|
||||
@@ -154,7 +154,7 @@ test('full core loop via UI: load → fly to destination → exact reward + rep
|
||||
expect(s.planes.find((p) => p.id === planeId)!.status).toBe('flying');
|
||||
expect(s.planes.find((p) => p.id === planeId)!.destIcao).toBe(nearest.icao);
|
||||
|
||||
// Fast-forward to arrival (≤ ~10 min game time at 60× → seconds of real time).
|
||||
// Fast-forward to arrival (a few seconds of real time at 1000×).
|
||||
await setScale(page, SCALE);
|
||||
await expect.poll(async () => ((await getState(page)).planes.find((p) => p.id === planeId)!.status), { timeout: 120_000 }).toBe('available');
|
||||
|
||||
@@ -230,7 +230,7 @@ test('abandon while grounded deducts exactly the formula penalty', async ({ page
|
||||
});
|
||||
|
||||
test('expired packages deliver and abandon with no reward and no penalty', async ({ page }) => {
|
||||
test.setTimeout(480_000); // two ~3 min real-time legs at 60× (HUB↔LEMD) plus expiry wait
|
||||
test.setTimeout(480_000); // two ~10 s real-time legs at 1000× (HUB↔LEMD) plus expiry wait
|
||||
await flyHomeViaApi(page);
|
||||
const before = await getState(page);
|
||||
|
||||
@@ -281,7 +281,7 @@ test('expired packages deliver and abandon with no reward and no penalty', async
|
||||
});
|
||||
|
||||
test('load and fly validation paths (404 / 409 / 400)', async ({ page }) => {
|
||||
test.setTimeout(600_000); // the FAR round trip alone is ~7.5 min real time at 60×
|
||||
test.setTimeout(600_000); // the FAR round trip alone is ~30 s real time at 1000×
|
||||
await flyHomeViaApi(page);
|
||||
|
||||
// Load a package whose origin the plane is not at → 409.
|
||||
|
||||
Reference in New Issue
Block a user