feat: 운영 안정성과 세션 음성 경험 개선
This commit is contained in:
parent
facc4ad2d9
commit
c788343467
95 changed files with 8431 additions and 1785 deletions
|
|
@ -59,25 +59,25 @@ test.describe("public admin visual @public-auth", () => {
|
|||
).toBeTruthy();
|
||||
|
||||
await expect(page).toHaveURL(/\/admin(?:$|[?#])/);
|
||||
await expect(page.locator(".ad-root")).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.locator("[data-vignette-admin-root]")).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.locator(".vg-shell")).toBeVisible();
|
||||
await expect(page.locator(".vg-nav").getByRole("link", { name: "운영 홈" })).toBeVisible();
|
||||
await expect(page.getByRole("heading", { name: "현재 서비스 상태" })).toBeVisible();
|
||||
await expect(page.getByRole("heading", { name: "AI 비용" })).toBeVisible();
|
||||
await expect(page.getByRole("heading", { name: "가용성" })).toBeVisible();
|
||||
await expect(page.getByRole("heading", { name: "운영 티켓" })).toBeVisible();
|
||||
await expect(page.locator(".ad-kpi b")).toHaveCount(4);
|
||||
await expect(page.locator(".vgops-kpi b")).toHaveCount(4);
|
||||
await expect(page.locator("#vignette-boot-diagnostic")).toHaveCount(0);
|
||||
|
||||
const visualReport = await page.evaluate(() => {
|
||||
const adminRoot = document.querySelector<HTMLElement>(".ad-root");
|
||||
const adminRoot = document.querySelector<HTMLElement>("[data-vignette-admin-root]");
|
||||
const main = document.querySelector<HTMLElement>("main");
|
||||
const heading = Array.from(document.querySelectorAll<HTMLElement>("h1,h2,h3")).find(
|
||||
(node) => node.textContent?.includes("현재 서비스 상태"),
|
||||
);
|
||||
const visibleNodes = Array.from(
|
||||
document.querySelectorAll<HTMLElement>(
|
||||
".ad-root,.ad-head,.ad-kpi,.ad-panel,.ad-service,.vg-shell,.vg-nav,h1,h2,h3,p,a,button",
|
||||
".vgops-root,.vgops-head,.vgops-kpi,.vgops-panel,.vgops-service,.vg-shell,.vg-nav,h1,h2,h3,p,a,button",
|
||||
),
|
||||
).filter((node) => {
|
||||
const rect = node.getBoundingClientRect();
|
||||
|
|
@ -128,6 +128,119 @@ test.describe("public admin visual @public-auth", () => {
|
|||
);
|
||||
});
|
||||
|
||||
test("shows the live Codex and Agy model catalogs with safe defaults", async ({ page }) => {
|
||||
if (!process.env.E2E_PUBLIC_STORAGE_STATE) {
|
||||
throw new Error(
|
||||
"Set E2E_PUBLIC_STORAGE_STATE to a storageState file captured after Google admin login.",
|
||||
);
|
||||
}
|
||||
|
||||
const pageErrors: string[] = [];
|
||||
const consoleErrors: string[] = [];
|
||||
page.on("pageerror", (error) => pageErrors.push(error.message));
|
||||
page.on("console", (message) => {
|
||||
if (message.type() === "error") consoleErrors.push(message.text());
|
||||
});
|
||||
|
||||
await page.goto("/admin/ai", { waitUntil: "domcontentloaded" });
|
||||
await expect(page.locator('[data-testid="admin-ai-page"]')).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
const provider = page.getByLabel("AI 엔진 공급자");
|
||||
const model = page.getByLabel("AI 기본 모델");
|
||||
const effort = page.getByLabel("AI 추론 강도");
|
||||
await expect(provider.locator("option")).toHaveCount(6);
|
||||
|
||||
await provider.selectOption("codex_cli");
|
||||
await expect(model).toBeEnabled({ timeout: 30_000 });
|
||||
await expect(model).toHaveValue("gpt-5.6-terra");
|
||||
await expect(effort).toHaveValue("medium");
|
||||
await expect(page.getByText("7개 모델 확인됨")).toBeVisible();
|
||||
|
||||
await provider.selectOption("agy_cli");
|
||||
await expect(model).toBeEnabled({ timeout: 30_000 });
|
||||
await expect(model).toHaveValue("gemini-3.6-flash-high");
|
||||
await expect(effort).toHaveValue("high");
|
||||
await expect(page.getByText("11개 모델 확인됨")).toBeVisible();
|
||||
|
||||
expect(pageErrors, JSON.stringify(pageErrors)).toEqual([]);
|
||||
expect(consoleErrors, JSON.stringify(consoleErrors)).toEqual([]);
|
||||
});
|
||||
|
||||
test("keeps the public admin visible with EasyList cosmetic filters active", async ({
|
||||
page,
|
||||
}) => {
|
||||
if (!process.env.E2E_PUBLIC_STORAGE_STATE) {
|
||||
throw new Error(
|
||||
"Set E2E_PUBLIC_STORAGE_STATE to a storageState file captured after Google admin login.",
|
||||
);
|
||||
}
|
||||
|
||||
const pageErrors: string[] = [];
|
||||
const consoleErrors: string[] = [];
|
||||
page.on("pageerror", (error) => pageErrors.push(error.message));
|
||||
page.on("console", (message) => {
|
||||
if (message.type() === "error") consoleErrors.push(message.text());
|
||||
});
|
||||
|
||||
await page.addInitScript(() => {
|
||||
// 모든 공개 관리자 navigation의 첫 paint부터 실제 EasyList 충돌 규칙을 적용한다.
|
||||
const style = document.createElement("style");
|
||||
style.dataset.testEasylist = "true";
|
||||
style.textContent = ".ad-root,.ad-section{display:none!important}";
|
||||
const install = () => {
|
||||
const target = document.head ?? document.documentElement;
|
||||
if (!target) return false;
|
||||
target.append(style);
|
||||
return true;
|
||||
};
|
||||
if (!install()) {
|
||||
const observer = new MutationObserver(() => {
|
||||
if (install()) observer.disconnect();
|
||||
});
|
||||
observer.observe(document, { childList: true, subtree: true });
|
||||
}
|
||||
});
|
||||
|
||||
const sections = [
|
||||
{ path: "/admin", heading: "현재 서비스 상태", root: "[data-vignette-admin-root]" },
|
||||
{ path: "/admin/ai", heading: "AI 운영과 DB 계량", root: "[data-testid='admin-ai-page']" },
|
||||
{ path: "/admin/users", heading: "가입 승인과 권한 관리", root: "[data-vignette-admin-root]" },
|
||||
{ path: "/admin/access", heading: "역할, 그룹, 접근 범위", root: "[data-vignette-admin-root]" },
|
||||
{ path: "/admin/tickets", heading: "사용자 문제 큐", root: "[data-vignette-admin-root]" },
|
||||
] as const;
|
||||
|
||||
for (const section of sections) {
|
||||
await page.goto(section.path, { waitUntil: "domcontentloaded" });
|
||||
await expect(page.locator(section.root)).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.getByRole("heading", { name: section.heading })).toBeVisible();
|
||||
await expect(page.locator('[class^="ad-"],[class*=" ad-"]')).toHaveCount(0);
|
||||
}
|
||||
|
||||
await page.waitForTimeout(4_000);
|
||||
await expect(page.locator("#vignette-boot-diagnostic")).toHaveCount(0);
|
||||
const adminRoot = page.locator("[data-vignette-admin-root]");
|
||||
await expect(adminRoot).toBeVisible();
|
||||
|
||||
const visibility = await adminRoot.evaluate((root) => {
|
||||
const rect = root.getBoundingClientRect();
|
||||
const style = getComputedStyle(root);
|
||||
return {
|
||||
width: rect.width,
|
||||
height: rect.height,
|
||||
display: style.display,
|
||||
visibility: style.visibility,
|
||||
opacity: style.opacity,
|
||||
};
|
||||
});
|
||||
expect(visibility.width, JSON.stringify(visibility)).toBeGreaterThan(900);
|
||||
expect(visibility.height, JSON.stringify(visibility)).toBeGreaterThan(500);
|
||||
expect(visibility.display, JSON.stringify(visibility)).not.toBe("none");
|
||||
expect(visibility.visibility, JSON.stringify(visibility)).not.toBe("hidden");
|
||||
expect(visibility.opacity, JSON.stringify(visibility)).not.toBe("0");
|
||||
expect(pageErrors, JSON.stringify(pageErrors)).toEqual([]);
|
||||
expect(consoleErrors, JSON.stringify(consoleErrors)).toEqual([]);
|
||||
});
|
||||
|
||||
test("renders every public admin section without a silent blank pane", async ({ page }) => {
|
||||
if (!process.env.E2E_PUBLIC_STORAGE_STATE) {
|
||||
throw new Error(
|
||||
|
|
@ -143,21 +256,24 @@ test.describe("public admin visual @public-auth", () => {
|
|||
});
|
||||
|
||||
const sections = [
|
||||
{ path: "/admin", heading: "현재 서비스 상태" },
|
||||
{ path: "/admin/users", heading: "가입 승인과 권한 관리" },
|
||||
{ path: "/admin/access", heading: "역할, 그룹, 접근 범위" },
|
||||
{ path: "/admin/tickets", heading: "사용자 문제 큐" },
|
||||
{ path: "/admin", heading: "현재 서비스 상태", root: "[data-vignette-admin-root]" },
|
||||
{ path: "/admin/ai", heading: "AI 운영과 DB 계량", root: "[data-testid='admin-ai-page']" },
|
||||
{ path: "/admin/users", heading: "가입 승인과 권한 관리", root: "[data-vignette-admin-root]" },
|
||||
{ path: "/admin/access", heading: "역할, 그룹, 접근 범위", root: "[data-vignette-admin-root]" },
|
||||
{ path: "/admin/tickets", heading: "사용자 문제 큐", root: "[data-vignette-admin-root]" },
|
||||
] as const;
|
||||
|
||||
for (const section of sections) {
|
||||
await page.goto(section.path, { waitUntil: "domcontentloaded" });
|
||||
await expect(page.locator(".ad-root")).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.locator(section.root)).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.getByRole("heading", { name: section.heading })).toBeVisible();
|
||||
await expect(page.locator(".ad-diagnostic")).toHaveCount(0);
|
||||
await expect(page.locator(".vgops-diagnostic")).toHaveCount(0);
|
||||
|
||||
const report = await page.evaluate(() => {
|
||||
const root = document.querySelector<HTMLElement>(".ad-root");
|
||||
const report = await page.evaluate((rootSelector) => {
|
||||
const root = document.querySelector<HTMLElement>(rootSelector);
|
||||
const main = document.querySelector<HTMLElement>(".vg-main");
|
||||
const rect = root?.getBoundingClientRect();
|
||||
const mainRect = main?.getBoundingClientRect();
|
||||
const visibleNodes = root
|
||||
? Array.from(root.querySelectorAll<HTMLElement>("h1,h2,p,button,input,select,article,section"))
|
||||
.filter((node) => {
|
||||
|
|
@ -166,6 +282,8 @@ test.describe("public admin visual @public-auth", () => {
|
|||
return (
|
||||
nodeRect.width > 1 &&
|
||||
nodeRect.height > 1 &&
|
||||
nodeRect.bottom > (mainRect?.top ?? 0) &&
|
||||
nodeRect.top < (mainRect?.bottom ?? window.innerHeight) &&
|
||||
style.display !== "none" &&
|
||||
style.visibility !== "hidden" &&
|
||||
style.opacity !== "0"
|
||||
|
|
@ -178,20 +296,38 @@ test.describe("public admin visual @public-auth", () => {
|
|||
width: rect?.width ?? 0,
|
||||
height: rect?.height ?? 0,
|
||||
scrollY: window.scrollY,
|
||||
mainScrollTop: main?.scrollTop ?? -1,
|
||||
};
|
||||
});
|
||||
}, section.root);
|
||||
|
||||
expect(report.textLength, JSON.stringify({ section, report })).toBeGreaterThan(120);
|
||||
expect(report.visibleNodes, JSON.stringify({ section, report })).toBeGreaterThan(5);
|
||||
expect(report.width, JSON.stringify({ section, report })).toBeGreaterThan(300);
|
||||
expect(report.height, JSON.stringify({ section, report })).toBeGreaterThan(120);
|
||||
expect(report.scrollY, JSON.stringify({ section, report })).toBe(0);
|
||||
expect(report.mainScrollTop, JSON.stringify({ section, report })).toBe(0);
|
||||
}
|
||||
|
||||
expect(pageErrors, JSON.stringify(pageErrors)).toEqual([]);
|
||||
expect(consoleErrors, JSON.stringify(consoleErrors)).toEqual([]);
|
||||
});
|
||||
|
||||
test("keeps the operating console visible from the primary learner workspace", async ({ page }) => {
|
||||
if (!process.env.E2E_PUBLIC_STORAGE_STATE) {
|
||||
throw new Error(
|
||||
"Set E2E_PUBLIC_STORAGE_STATE to a storageState file captured after Google admin login.",
|
||||
);
|
||||
}
|
||||
|
||||
await page.goto("/learn", { waitUntil: "domcontentloaded" });
|
||||
const adminEntry = page.locator(".vg-nav").getByRole("link", { name: "운영 콘솔" });
|
||||
await expect(adminEntry).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
await adminEntry.click();
|
||||
await expect(page).toHaveURL(/\/admin(?:$|[?#])/);
|
||||
await expect(page.getByRole("heading", { name: "현재 서비스 상태" })).toBeVisible();
|
||||
});
|
||||
|
||||
test("returns a restored admin tab to visible content after pageshow", async ({ page }) => {
|
||||
if (!process.env.E2E_PUBLIC_STORAGE_STATE) {
|
||||
throw new Error(
|
||||
|
|
@ -201,13 +337,15 @@ test.describe("public admin visual @public-auth", () => {
|
|||
|
||||
await page.goto("/admin", { waitUntil: "domcontentloaded" });
|
||||
await expect(page.getByRole("heading", { name: "현재 서비스 상태" })).toBeVisible();
|
||||
await expect(page.locator(".ad-root")).toBeVisible();
|
||||
await expect(page.locator("[data-vignette-admin-root]")).toBeVisible();
|
||||
|
||||
const beforeRestore = await page.evaluate(() => {
|
||||
document.documentElement.style.minHeight = "2200px";
|
||||
document.body.style.minHeight = "2200px";
|
||||
window.scrollTo(0, 900);
|
||||
return window.scrollY;
|
||||
const main = document.querySelector<HTMLElement>(".vg-main");
|
||||
const root = document.querySelector<HTMLElement>("[data-vignette-admin-root]");
|
||||
if (!main || !root) throw new Error("admin scroll container missing");
|
||||
root.style.minHeight = "2200px";
|
||||
main.scrollTop = 900;
|
||||
return main.scrollTop;
|
||||
});
|
||||
expect(beforeRestore).toBeGreaterThan(0);
|
||||
|
||||
|
|
@ -216,7 +354,13 @@ test.describe("public admin visual @public-auth", () => {
|
|||
});
|
||||
|
||||
await expect
|
||||
.poll(() => page.evaluate(() => window.scrollY), { timeout: 5_000 })
|
||||
.poll(
|
||||
() =>
|
||||
page.evaluate(
|
||||
() => document.querySelector<HTMLElement>(".vg-main")?.scrollTop ?? -1,
|
||||
),
|
||||
{ timeout: 5_000 },
|
||||
)
|
||||
.toBe(0);
|
||||
await expect(page.getByRole("heading", { name: "현재 서비스 상태" })).toBeInViewport();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue