Adds a shared fixed-position debugging dock (Controls/State/Log tabs) gated to dynamic superusers, mounted per minigame. Multiplayer games gain synced server-authoritative admin commands with [dev-admin] audit logging: poker (force fold, force street, per-viewer reveal-all, clock control, stack adjust, force expire), blackjack (bankroll adjust, next-card injection, dealer override, force expire), bomperator (pure applyAdminCommand: crates, pickups, eliminate, freeze, sudden death, timer, end round; mirrored over the arena REST path), and CFF Versus (reveal fleets, force shot outcome, skip turn). Solo games get client-side tuning via persisted dev settings: flappy physics sliders plus pause and invincibility, EOD layout reveal and seeded boards, radio transcript view and timer freeze, aim trainer seed and difficulty overrides plus hitbox overlay, OPORD answer reveal and study window, call-for-fire target reveal, seeded grids, and free corrections. Includes 26 new integration specs (command purity, gating, audit lines) and a poker e2e smoke for the dock. Plan: Minigame Developer Console.
56 lines
2.4 KiB
TypeScript
56 lines
2.4 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
/**
|
|
* Smoke test for the shared minigame developer dock after the poker panel
|
|
* migration: the old inline PokerDevPanel dialog is gone, and superusers get
|
|
* the floating dock instead (collapsed Shield button -> Controls/State/Log
|
|
* tabs). The dev login seeded by global-setup holds a superuser role doc, so
|
|
* the dock must render for it; the dock's gating itself (server-side
|
|
* isSuperuser checks on every action) is covered by
|
|
* tests/int/minigame-dev-console-gating.int.spec.ts.
|
|
*/
|
|
test.describe("Minigame dev console (poker smoke)", () => {
|
|
test("superuser sees the dock on a poker table and can open all three tabs", async ({
|
|
page,
|
|
}) => {
|
|
await page.goto("/login");
|
|
await page.getByLabel("Username").fill("dev");
|
|
await page.getByLabel("Password").fill("Test123");
|
|
await page.getByRole("button", { name: "Log in" }).click();
|
|
await page.waitForURL((url) => !url.pathname.startsWith("/login"), { timeout: 30_000 });
|
|
|
|
await page.goto("/minigames/poker");
|
|
await expect(page.getByRole("heading", { name: /poker/i }).first()).toBeVisible({
|
|
timeout: 60_000,
|
|
});
|
|
|
|
await page.getByRole("button", { name: "Create table" }).click();
|
|
|
|
// Collapsed dock = the Shield button in the bottom-right corner.
|
|
const dockButton = page.getByRole("button", { name: "Developer controls" });
|
|
await expect(dockButton).toBeVisible({ timeout: 30_000 });
|
|
|
|
await dockButton.click();
|
|
await expect(page.getByText("Poker dev console")).toBeVisible({ timeout: 10_000 });
|
|
await expect(page.getByRole("tab", { name: "Controls" })).toBeVisible();
|
|
|
|
// State tab: raw snapshot JSON inspector.
|
|
await page.getByRole("tab", { name: "State" }).click();
|
|
await expect(page.getByText("Raw snapshot JSON")).toBeVisible();
|
|
await expect(page.getByText(/"tableId"/)).toBeVisible();
|
|
|
|
// Log tab: the dock logs every received snapshot version.
|
|
await page.getByRole("tab", { name: /^Log/ }).click();
|
|
await expect(page.getByText(/poker: snapshot v\d+ received/).first()).toBeVisible({
|
|
timeout: 15_000,
|
|
});
|
|
|
|
// Back to Controls: in the waiting room there is no live hand yet, so the
|
|
// per-hand sections are absent; the tab itself must stay interactive.
|
|
await page.getByRole("tab", { name: "Controls" }).click();
|
|
await expect(page.getByRole("tab", { name: "Controls" })).toHaveAttribute(
|
|
"data-state",
|
|
"active",
|
|
);
|
|
});
|
|
});
|