test(e2e): Studio 화면 시험은 데모 세션으로 로그인한 뒤 본다
5e2b1a5(08-20)부터 로그인하지 않은 방문자는 Studio 경로에서 로그인 화면만 받는다. e2e 빌드는 local profile(AUTH_MODE demo)이고, 데모 세션은 로그아웃 상태로 시작해 메모리에만 있다. 그런데 Studio 시험은 로그인하지 않고 들어간다. 그래서 - 편집기·접근성 시험은 로그인 화면에서 「저장」 버튼이나 「요약」 칸을 기다리다 떨어지고, - 경로별 axe 검사(accessibility.spec)와 visual 시험은 Studio 경로 12개에서 Studio 화면 대신 로그인 화면을 검사하고 있었다. tech-log-fixtures.ts에 gotoTechLogStudio를 둔다. gotoTechLog 뒤에 작성자가 쓰는 「로그인 시작」 버튼을 누르고, 로그인한 세션만 받는 Studio 머리말이 뜰 때까지 기다린다. Studio 경로를 여는 e2e·접근성·visual 시험이 이것을 쓴다. 버린 대안: 앱의 세션을 시험에서 직접 authenticated로 바꾸기. 로그인 버튼과 관문 동작을 건너뛰게 되고, 앱 내부에 시험용 구멍이 필요하다. 위험: 이 변경으로 Studio 화면을 실제로 검사하게 되면서, 로그인 화면에 가려져 있던 결함이 드러난다. MOCK Studio에서도 관리 기능(주제·프로젝트· 릴리즈)이 실제 HTTP(/api/v1/studio/session)로 나가 연결이 거부된다 (create-tech-log-feature-input.ts의 createManagementGateway에 MOCK 분기가 없다). 그 결함은 이 PR 밖이다. 그동안 Studio 편집기·대시보드 시험은 그 이유로 실패한다. 검증: Studio 경로에서 로그인 뒤 Studio 머리말과 주 탐색이 뜨는 것을 error-context 스냅숏으로 확인했다. 남은 실패는 모두 위 HTTP 요청이다.
This commit is contained in:
@@ -3,6 +3,7 @@ import AxeBuilder from "@axe-core/playwright";
|
|||||||
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
||||||
import {
|
import {
|
||||||
gotoTechLog,
|
gotoTechLog,
|
||||||
|
gotoTechLogStudio,
|
||||||
TECH_LOG_CANONICAL_ROUTES,
|
TECH_LOG_CANONICAL_ROUTES,
|
||||||
} from "../support/browser/tech-log-fixtures.ts";
|
} from "../support/browser/tech-log-fixtures.ts";
|
||||||
|
|
||||||
@@ -12,7 +13,11 @@ for (const route of TECH_LOG_CANONICAL_ROUTES.filter(
|
|||||||
test(`@a11y ${route.routeId} has no critical or serious Axe violations`, async ({
|
test(`@a11y ${route.routeId} has no critical or serious Axe violations`, async ({
|
||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
await gotoTechLog(page, route.path);
|
// A Studio route checks the screen a writer gets, not the sign-in surface.
|
||||||
|
await (route.layout === "STUDIO" ? gotoTechLogStudio : gotoTechLog)(
|
||||||
|
page,
|
||||||
|
route.path,
|
||||||
|
);
|
||||||
const results = await new AxeBuilder({ page })
|
const results = await new AxeBuilder({ page })
|
||||||
.withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"])
|
.withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"])
|
||||||
.analyze();
|
.analyze();
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import AxeBuilder from "@axe-core/playwright";
|
import AxeBuilder from "@axe-core/playwright";
|
||||||
|
|
||||||
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
||||||
import { gotoTechLog } from "../support/browser/tech-log-fixtures.ts";
|
import {
|
||||||
|
gotoTechLog,
|
||||||
|
gotoTechLogStudio,
|
||||||
|
} from "../support/browser/tech-log-fixtures.ts";
|
||||||
|
|
||||||
function blockingViolations(results: Awaited<ReturnType<AxeBuilder["analyze"]>>) {
|
function blockingViolations(results: Awaited<ReturnType<AxeBuilder["analyze"]>>) {
|
||||||
return results.violations.filter((violation) =>
|
return results.violations.filter((violation) =>
|
||||||
@@ -26,7 +29,7 @@ test("Studio mobile navigation is keyboard reachable and exposes its expanded st
|
|||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
await page.setViewportSize({ width: 390, height: 844 });
|
await page.setViewportSize({ width: 390, height: 844 });
|
||||||
await gotoTechLog(page, "/studio");
|
await gotoTechLogStudio(page, "/studio");
|
||||||
const trigger = page.locator(".studio-menu-trigger");
|
const trigger = page.locator(".studio-menu-trigger");
|
||||||
await trigger.focus();
|
await trigger.focus();
|
||||||
await page.keyboard.press("Enter");
|
await page.keyboard.press("Enter");
|
||||||
@@ -37,7 +40,7 @@ test("Studio mobile navigation is keyboard reachable and exposes its expanded st
|
|||||||
test("dirty-leave dialog is labelled, traps focus, and restores the invoking link", async ({
|
test("dirty-leave dialog is labelled, traps focus, and restores the invoking link", async ({
|
||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
await gotoTechLog(
|
await gotoTechLogStudio(
|
||||||
page,
|
page,
|
||||||
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
|
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
|
||||||
);
|
);
|
||||||
@@ -63,7 +66,7 @@ test("open Public search and Studio leave dialogs have no blocking Axe findings"
|
|||||||
.analyze();
|
.analyze();
|
||||||
expect(blockingViolations(results)).toEqual([]);
|
expect(blockingViolations(results)).toEqual([]);
|
||||||
|
|
||||||
await gotoTechLog(
|
await gotoTechLogStudio(
|
||||||
page,
|
page,
|
||||||
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
|
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
||||||
import {
|
import {
|
||||||
gotoTechLog,
|
gotoTechLog,
|
||||||
|
gotoTechLogStudio,
|
||||||
horizontalOverflow,
|
horizontalOverflow,
|
||||||
TECH_LOG_BREAKPOINT_WIDTHS,
|
TECH_LOG_BREAKPOINT_WIDTHS,
|
||||||
} from "../support/browser/tech-log-fixtures.ts";
|
} from "../support/browser/tech-log-fixtures.ts";
|
||||||
@@ -29,7 +30,7 @@ for (const width of [1050, 1024, 980, 900, 820, 768, 767, 420, 390, 375] as cons
|
|||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
await page.setViewportSize({ width, height: 1000 });
|
await page.setViewportSize({ width, height: 1000 });
|
||||||
await gotoTechLog(
|
await gotoTechLogStudio(
|
||||||
page,
|
page,
|
||||||
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
|
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -138,6 +138,27 @@ export async function gotoTechLog(page: Page, path: string) {
|
|||||||
await settleTechLogPage(page);
|
await settleTechLogPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5e2b1a5 (08-20). A signed-out visitor gets only the sign-in surface on a
|
||||||
|
* Studio route. The e2e build is the local profile (`AUTH_MODE: "demo"`), whose
|
||||||
|
* session starts signed out and lives in memory, so every page load starts
|
||||||
|
* signed out again. This signs in with the button a writer uses and waits for
|
||||||
|
* the Studio chrome that only a signed-in session gets.
|
||||||
|
*/
|
||||||
|
export async function signInToStudio(page: Page) {
|
||||||
|
const gate = page.locator('[data-surface="authentication-required"]');
|
||||||
|
await gate.getByRole("button", { name: "로그인 시작" }).click();
|
||||||
|
await page.locator("header.studio-header").waitFor();
|
||||||
|
await gate.waitFor({ state: "detached" });
|
||||||
|
await page.waitForLoadState("networkidle");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** `gotoTechLog` for a Studio route, signed in. */
|
||||||
|
export async function gotoTechLogStudio(page: Page, path: string) {
|
||||||
|
await gotoTechLog(page, path);
|
||||||
|
await signInToStudio(page);
|
||||||
|
}
|
||||||
|
|
||||||
export async function horizontalOverflow(page: Page) {
|
export async function horizontalOverflow(page: Page) {
|
||||||
return page.evaluate(() => ({
|
return page.evaluate(() => ({
|
||||||
clientWidth: document.documentElement.clientWidth,
|
clientWidth: document.documentElement.clientWidth,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
||||||
import {
|
import {
|
||||||
gotoTechLog,
|
gotoTechLog,
|
||||||
|
gotoTechLogStudio,
|
||||||
TECH_LOG_BREAKPOINT_WIDTHS,
|
TECH_LOG_BREAKPOINT_WIDTHS,
|
||||||
TECH_LOG_CANONICAL_ROUTES,
|
TECH_LOG_CANONICAL_ROUTES,
|
||||||
TECH_LOG_PUBLIC_FIXTURE_PATHS,
|
TECH_LOG_PUBLIC_FIXTURE_PATHS,
|
||||||
@@ -16,7 +17,10 @@ for (const route of TECH_LOG_CANONICAL_ROUTES) {
|
|||||||
for (const width of [360, 1440] as const) {
|
for (const width of [360, 1440] as const) {
|
||||||
test(`${route.routeId} matches the reviewed ${width}px visual`, async ({ page }) => {
|
test(`${route.routeId} matches the reviewed ${width}px visual`, async ({ page }) => {
|
||||||
await page.setViewportSize({ width, height: 1000 });
|
await page.setViewportSize({ width, height: 1000 });
|
||||||
await gotoTechLog(page, route.path);
|
await (route.layout === "STUDIO" ? gotoTechLogStudio : gotoTechLog)(
|
||||||
|
page,
|
||||||
|
route.path,
|
||||||
|
);
|
||||||
await expect(page).toHaveScreenshot(`${route.routeId.toLowerCase()}-${width}.png`, {
|
await expect(page).toHaveScreenshot(`${route.routeId.toLowerCase()}-${width}.png`, {
|
||||||
fullPage: true,
|
fullPage: true,
|
||||||
});
|
});
|
||||||
@@ -49,7 +53,7 @@ for (const width of TECH_LOG_BREAKPOINT_WIDTHS) {
|
|||||||
for (const [state, path] of TECH_LOG_STUDIO_STATE_PATHS) {
|
for (const [state, path] of TECH_LOG_STUDIO_STATE_PATHS) {
|
||||||
test(`Studio ${state} matches its reviewed wide state visual`, async ({ page }) => {
|
test(`Studio ${state} matches its reviewed wide state visual`, async ({ page }) => {
|
||||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||||
await gotoTechLog(page, path);
|
await gotoTechLogStudio(page, path);
|
||||||
await expect(page).toHaveScreenshot(`tech-log-studio-${state}-1440.png`, {
|
await expect(page).toHaveScreenshot(`tech-log-studio-${state}-1440.png`, {
|
||||||
fullPage: true,
|
fullPage: true,
|
||||||
});
|
});
|
||||||
@@ -82,7 +86,7 @@ test("open Public search dialog matches the source without a mask", async ({ pag
|
|||||||
|
|
||||||
test("open Studio mobile menu matches the source without a mask", async ({ page }) => {
|
test("open Studio mobile menu matches the source without a mask", async ({ page }) => {
|
||||||
await page.setViewportSize({ width: 390, height: 844 });
|
await page.setViewportSize({ width: 390, height: 844 });
|
||||||
await gotoTechLog(page, "/studio");
|
await gotoTechLogStudio(page, "/studio");
|
||||||
await page.getByRole("button", { name: "Studio 메뉴 열기" }).click();
|
await page.getByRole("button", { name: "Studio 메뉴 열기" }).click();
|
||||||
await expect(page).toHaveScreenshot("tech-log-studio-mobile-menu-390.png", {
|
await expect(page).toHaveScreenshot("tech-log-studio-mobile-menu-390.png", {
|
||||||
fullPage: true,
|
fullPage: true,
|
||||||
@@ -91,7 +95,7 @@ test("open Studio mobile menu matches the source without a mask", async ({ page
|
|||||||
|
|
||||||
test("Studio immediate preview matches the source without a mask", async ({ page }) => {
|
test("Studio immediate preview matches the source without a mask", async ({ page }) => {
|
||||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||||
await gotoTechLog(
|
await gotoTechLogStudio(
|
||||||
page,
|
page,
|
||||||
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
|
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
|
||||||
);
|
);
|
||||||
@@ -103,7 +107,7 @@ test("Studio immediate preview matches the source without a mask", async ({ page
|
|||||||
|
|
||||||
test("Studio dirty-leave dialog matches the source without a mask", async ({ page }) => {
|
test("Studio dirty-leave dialog matches the source without a mask", async ({ page }) => {
|
||||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||||
await gotoTechLog(
|
await gotoTechLogStudio(
|
||||||
page,
|
page,
|
||||||
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
|
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
|
||||||
);
|
);
|
||||||
@@ -119,7 +123,7 @@ test("Studio dirty-leave dialog matches the source without a mask", async ({ pag
|
|||||||
|
|
||||||
test("Studio newly-created current preview matches the source without a mask", async ({ page }) => {
|
test("Studio newly-created current preview matches the source without a mask", async ({ page }) => {
|
||||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||||
await gotoTechLog(
|
await gotoTechLogStudio(
|
||||||
page,
|
page,
|
||||||
"/studio/documents/11111111-1111-4111-8111-111111111113/preview",
|
"/studio/documents/11111111-1111-4111-8111-111111111113/preview",
|
||||||
);
|
);
|
||||||
@@ -132,7 +136,7 @@ test("Studio newly-created current preview matches the source without a mask", a
|
|||||||
|
|
||||||
test("Studio unpublish confirmation matches the source without a mask", async ({ page }) => {
|
test("Studio unpublish confirmation matches the source without a mask", async ({ page }) => {
|
||||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||||
await gotoTechLog(page, "/studio/publications");
|
await gotoTechLogStudio(page, "/studio/publications");
|
||||||
await page
|
await page
|
||||||
.getByRole("button", {
|
.getByRole("button", {
|
||||||
name: /컬렉션 Fetch Join과 페이징은 왜 충돌하는가 게시 취소/,
|
name: /컬렉션 Fetch Join과 페이징은 왜 충돌하는가 게시 취소/,
|
||||||
@@ -148,7 +152,7 @@ test("Studio warning acknowledgement publish state matches the source without a
|
|||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||||
await gotoTechLog(
|
await gotoTechLogStudio(
|
||||||
page,
|
page,
|
||||||
"/studio/documents/11111111-1111-4111-8111-111111111116/validation",
|
"/studio/documents/11111111-1111-4111-8111-111111111116/validation",
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user