import { expect, test } from "@playwright/test"; test("player can complete the first useful answer journey", async ({ page }) => { const query = "/?hours=24&sort=activity"; await page.setViewportSize({ width: 390, height: 844 }); await page.goto(query); await page.evaluate(() => localStorage.removeItem("rf4spotter:fishing-plan")); const firstCard = page.locator(".spot-card").first(); await expect(firstCard).toBeVisible(); await expect(firstCard).toContainText("Свежесть"); await expect(firstCard).toContainText("Наблюдения"); await expect(firstCard).toContainText("Координаты"); await expect(firstCard.locator(".source-chip").first()).toBeVisible(); await expect(firstCard.getByText("Открыть точку")).toBeVisible(); await firstCard.getByText("Открыть точку").click(); await expect(page.getByRole("heading", { name: /^Точка / })).toBeVisible(); await expect(page.getByRole("heading", { name: "Что взять" })).toBeVisible(); await expect(page.locator("aside .data-passport")).toContainText("Доверие"); await expect(page.locator("aside .data-passport")).toContainText("Наблюдения"); const save = page.getByRole("button", { name: "Сохранить в план" }); await save.click(); await expect(page.getByRole("button", { name: "В плане" })).toHaveAttribute("aria-pressed", "true"); await page.goBack(); await expect(page).toHaveURL(query); await page.goto("/plan"); await expect(page.getByText("1 из 5 точек")).toBeVisible(); await expect(page.getByRole("link", { name: "Открыть точку" })).toBeVisible(); });