Commit Graph
3 Commits
Author SHA1 Message Date
db9979 7bf663913c Tutorial e2e: pin the found contact before classifying (the re-rendering list could hand the class to a merchant) 2026-11-23 11:39:28 +01:00
db9979 eae9a45126 Tutorial e2e robust on cold starts; Erste Feindfahrt handles a missed torpedo
- Cold start: the lobby's shader warm-up (software WebGL in headless Chrome) landed right
  when the lessons started and froze both tabs for ~32 s, so step 1 ticked after the test's
  deadline. The test now pre-warms Vite in a throwaway tab (until no dependency re-optimization)
  and waits for the lobby warm-up (prefetch.ts: warmUpDone()) before starting the lessons.
- Test: reloads are detected and logged, the hook is re-installed; main-thread stalls are
  reported per step; waitFor takes one last look after its deadline; failure dumps read the
  folded panel via textContent and include the torpedoes. CDP helpers moved to scripts/cdp-tab.mjs.
- Erste Feindfahrt: a shot misses when the solution's range is too long (the seeker switches on
  behind the target). Step 10 now ticks on the hit only and tells the player to fire again with
  the seeker on at half the distance; unit test for miss and second shot. The test re-fires
  missed torpedoes and rockets (Erste Geleitfahrt already said: ping again, another rocket).
2026-11-23 11:22:18 +01:00
db9979 3122d1b276 Erste Geleitfahrt: guided frigate tutorial; both tutorials as a browser test in CI
- New lesson "geleitfahrt" (apps/server/src/first-escort.ts): frigate ahead of a
  three-merchant convoy, one damaged diesel boat with no captain coming the other way
  deep at 10 kn; no layer, calm sea. Sim-verified: towed array hears it ~6 min in,
  LFM ping ranges it at 6-7 km, one ASW rocket sinks it.
- Ten sequential steps (tutorial-geleitfahrt.ts): speed, stream 900 m, settle, deep
  buoy, pick contact, classify U-Boot, divert convoy or radio, LFM ping range, rocket,
  hit. Lobby button, protocol/zod lesson ids, English texts, handbook paragraph (rebuilt).
- Vitest: scenario, result rule, lobby start and a sim playthrough over three seeds.
- scripts/tutorial-e2e.mjs (npm run e2e:tutorials, CI e2e job): plays "Erste
  Feindfahrt" and "Erste Geleitfahrt" side by side through the UI in headless Chrome,
  asserts every step ticks (none skipped), success, no page errors. About 4.5 min.
2026-11-23 09:59:23 +01:00