import { expect, test } from "@playwright/test"; /** * Mobile layout smoke for Ordnance Disposal (touch-controls feature). * * Guards the responsive shell at phone size: login works on a coarse-pointer * viewport, the game page renders, and nothing overflows horizontally. Real * touch interaction (D-pad, swipes, multi-touch planting) is verified by * manual playtest with a phone and desktop in one live match; automating the * canvas itself would only re-test the engine, which the integration suite * already covers deterministically. */ test.describe("Bomperator mobile layout", () => { test.use({ viewport: { width: 390, height: 844 }, hasTouch: true, isMobile: true, }); test("game page loads at phone width without horizontal overflow", 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/bomperator"); await expect( page.getByRole("heading", { name: /ordnance disposal/i }).first(), ).toBeVisible({ timeout: 60_000 }); const overflow = await page.evaluate( () => document.documentElement.scrollWidth - document.documentElement.clientWidth, ); expect(overflow).toBeLessThanOrEqual(1); }); });