mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-15 11:22:15 +03:00
* feat(homolog): scaffolding da suíte de homologação E2E (deps + npm run homolog) * feat(homolog): L0 avaliador de paridade de deploy (TDD) * feat(homolog): L1a ciclo de vida de API key efêmera (login admin -> create -> revoke) * feat(homolog): L1b suite httpYac de API (models, chat, auth de management, health) * feat(homolog): L1c checker SSE de streaming real (TDD no parser) * feat(homolog): L2 smoke de providers reais via promptfoo gerado do catálogo * feat(homolog): L4a Playwright homolog config + login storageState * feat(homolog): L4b smoke de todas as rotas do dashboard (descoberta via fs) * feat(homolog): L4c fluxo criar/revogar API key pela UI * fix(homolog): resiliencia real-environment — stream:false no smoke promptfoo, retry de socket keep-alive, key efemera com sufixo unico * feat(homolog): L5 orquestrador npm run homolog + relatorio CTRF unificado * docs(homolog): guia de operacao da suite + fragment de changelog + allowlist env-doc-sync * fix(homolog): paraleliza o sweep de rotas do dashboard (fullyParallel + 8 workers) * fix(homolog): isola outputs crus em homolog-report/raw para nao quebrar o ctrf merge * fix(homolog): outputDir absoluto do reporter CTRF da UI (path relativo escapava do worktree) * chore(quality): allowlist the 5 homolog-suite devDependencies (ctrf-io trio, httpyac, promptfoo) after registry verification * chore(quality): register the homolog Playwright suite as a test-discovery collector (run.mjs -> tests/homolog/ui)
32 lines
1.6 KiB
TypeScript
32 lines
1.6 KiB
TypeScript
import { test, expect } from "@playwright/test";
|
|
|
|
// Locators confirmados em
|
|
// src/app/(dashboard)/dashboard/api-manager/ApiManagerPageClient.tsx (rota real da
|
|
// tela de keys é /dashboard/api-manager, não /dashboard/api-keys):
|
|
// - botão "Create API Key" (t("createKey")) abre o modal; o submit do modal tem o mesmo texto
|
|
// - <Input placeholder={t("keyNamePlaceholder")}> = "e.g. Production Key"
|
|
// - após criar, abre o "Created Key Modal" (t("keyCreated")) — fechar pelo botão t("done")="Done"
|
|
// - cada key vira uma linha div.grid-cols-12; o botão de deletar tem title={t("deleteKey")}="Delete key"
|
|
// - handleDeleteKey usa window.confirm(t("deleteConfirm")) — não é modal de UI,
|
|
// precisa do listener page.on("dialog", ...).
|
|
const KEY_NAME = `homolog-ui-${Date.now()}`;
|
|
|
|
test("cria e revoga uma API key pela UI", async ({ page }) => {
|
|
page.on("dialog", (dialog) => dialog.accept());
|
|
|
|
await page.goto("/dashboard/api-manager");
|
|
await page.getByRole("button", { name: "Create API Key" }).first().click();
|
|
await page.getByPlaceholder("e.g. Production Key").fill(KEY_NAME);
|
|
// segundo "Create API Key" é o submit do modal (o primeiro é o botão que o abriu)
|
|
await page.getByRole("button", { name: "Create API Key" }).last().click();
|
|
|
|
// fecha o modal "API Key Created"
|
|
await page.getByRole("button", { name: "Done" }).click();
|
|
const row = page.locator("div.grid-cols-12", { hasText: KEY_NAME });
|
|
await expect(row).toHaveCount(1);
|
|
|
|
// revoga a mesma key (cleanup — a suíte não deixa lixo na VPS)
|
|
await row.getByTitle("Delete key").click();
|
|
await expect(page.locator("div.grid-cols-12", { hasText: KEY_NAME })).toHaveCount(0);
|
|
});
|