sdlc-hub/web/e2e/overview.spec.ts
Andrey Epifancev e2c925bff2 docs(web-modules): ARCHITECTURE, CLAUDE.md, README, e2e под модули
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 15:38:46 +04:00

35 lines
2.1 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { expect, test } from "@playwright/test";
import { agentServeRefresh, login } from "./hub.ts";
test("«Обзор»: / → /app/?project=…, две карточки модулей, список пакетов", async ({ page }) => {
await login(page, "/app/");
await expect(page).toHaveURL(/\/app\/?\?project=AWPCA$/);
await expect(page.getByTestId("page-overview")).toBeVisible();
await expect(page.getByRole("heading", { level: 1, name: "Обзор" })).toBeVisible();
const cards = page.locator(".overview-card");
await expect(cards).toHaveCount(2);
await expect(page.getByRole("region", { name: "Jira" })).toBeVisible();
await expect(page.getByRole("region", { name: "Вики" })).toBeVisible();
await expect(page.getByRole("heading", { name: "Последние пакеты проекта" })).toBeVisible();
});
test("«Обзор»: «Обновить из Jira» ставит пакет и доводит до конца", async ({ page }) => {
await login(page, "/app/");
const card = page.getByRole("region", { name: "Jira" });
await card.getByRole("button", { name: "Обновить из Jira" }).click();
await expect(card.getByRole("status")).toContainText(/пакет #\d+/);
await agentServeRefresh();
await expect(card.getByRole("status")).toContainText(/выполнен/, { timeout: 15_000 });
});
test("«Обзор»: пакет проекта («Обновить вики») появляется в «Последних пакетах проекта»", async ({ page }) => {
await login(page, "/app/");
await expect(page.getByText("Пакетов пока не было.")).toBeVisible();
await page.getByRole("region", { name: "Вики" }).getByRole("button", { name: "Обновить вики" }).click();
// список пакетов опрашивается раз в 15 с; агента wiki в тестовом хабе нет — пакет остаётся в очереди
const row = page.locator("table.overview-table tbody tr").first();
await expect(row).toBeVisible({ timeout: 25_000 });
await expect(row).toContainText("Вики");
await expect(row).toContainText("в очереди");
});