diff --git a/app/game-engine/src/scenario/scenarioSeeder.ts b/app/game-engine/src/scenario/scenarioSeeder.ts index fabe1c5d..67a34404 100644 --- a/app/game-engine/src/scenario/scenarioSeeder.ts +++ b/app/game-engine/src/scenario/scenarioSeeder.ts @@ -54,6 +54,7 @@ export interface ScenarioInstallOptions { season?: number; firstGameIdx?: number; serverId?: string; + serverName?: string; installOperationId?: string; installCommitSha?: string; } @@ -315,6 +316,9 @@ export const seedScenarioToDatabase = async (options: ScenarioSeedOptions): Prom if (typeof install?.serverId === 'string' && install.serverId.trim()) { worldMeta.serverId = install.serverId.trim(); } + if (typeof install?.serverName === 'string' && install.serverName.trim()) { + worldMeta.serverName = install.serverName.trim(); + } if (typeof install?.installOperationId === 'string' && install.installOperationId.trim()) { worldMeta.installOperationId = install.installOperationId.trim(); } diff --git a/app/game-engine/test/monthlyCreateManyNpcAction.test.ts b/app/game-engine/test/monthlyCreateManyNpcAction.test.ts index ceab6680..37a6579a 100644 --- a/app/game-engine/test/monthlyCreateManyNpcAction.test.ts +++ b/app/game-engine/test/monthlyCreateManyNpcAction.test.ts @@ -151,6 +151,25 @@ const buildHarness = ( }; describe('CreateManyNPC monthly action', () => { + it('creates exactly 50 ordinary M generals without fill-count expansion', async () => { + const { world, reservedTurns, handler, environment } = buildHarness(); + + await handler([50, 0], environment, { + id: 1, + targetCode: 'month', + priority: 1, + condition: true, + action: [], + meta: {}, + }); + + const created = world.peekDirtyState().createdGenerals; + expect(created).toHaveLength(50); + expect(created.every((general) => general.npcState === 3 && general.name.startsWith('ⓜ'))).toBe(true); + expect(reservedTurns.peekDirtyState().generalInitializationIds).toHaveLength(50); + expect(world.peekDirtyState().logs.map((log) => log.text)).toContain('장수 50명이 등장하였습니다.'); + }); + it('uses and consumes an available U30 candidate without random-name or random-stat fallback', async () => { const info = { generalName: '풀장수', diff --git a/app/game-engine/test/scenarioLoader.test.ts b/app/game-engine/test/scenarioLoader.test.ts index afb9eaa2..3628fc58 100644 --- a/app/game-engine/test/scenarioLoader.test.ts +++ b/app/game-engine/test/scenarioLoader.test.ts @@ -52,10 +52,38 @@ describe('tracked scenario resources', () => { expect(scenarioIds).toContain(914); expect(scenarioIds).toContain(915); + expect(scenarioIds).toContain(916); const scenarios = await Promise.all(scenarioIds.map((scenarioId) => loadScenarioDefinitionById(scenarioId))); expect(scenarios.every((scenario) => scenario.title.length > 0)).toBe(true); }); + it('keeps scenario 916 equal to ordinary blank land except for its launch modifiers', async () => { + const [ordinaryBlank, dawn] = await Promise.all( + [0, 916].map((scenarioId) => loadScenarioDefinitionById(scenarioId)) + ); + const { uniqueTrialCoef, ...dawnConst } = dawn.config.const; + + expect(dawn.title).toBe('【공백지】 여명'); + expect(uniqueTrialCoef).toBe(2); + expect({ ...dawn.config, const: dawnConst }).toEqual(ordinaryBlank.config); + expect(dawn.history).toEqual(ordinaryBlank.history); + expect(dawn.events[0]).toEqual([ + 'month', + 1000, + ['or', ['Date', '==', null, 12], ['Date', '==', null, 6]], + ['CreateManyNPC', 50, 0], + ['DeleteEvent'], + ]); + expect(dawn.events.slice(1)).toEqual(ordinaryBlank.events.slice(1)); + + expect({ + ...dawn, + title: ordinaryBlank.title, + events: ordinaryBlank.events, + config: ordinaryBlank.config, + }).toEqual(ordinaryBlank); + }); + refSourceIt('preserves the Ref scenario 915 S100 pool and event order exactly', async () => { const referencePath = path.join(resolveRefSourceRoot(), 'hwe', 'scenario', 'scenario_915.json'); const [scenario, referenceSource] = await Promise.all([ diff --git a/app/game-engine/test/scenarioSeeder.test.ts b/app/game-engine/test/scenarioSeeder.test.ts index b81d9a3e..11a337d4 100644 --- a/app/game-engine/test/scenarioSeeder.test.ts +++ b/app/game-engine/test/scenarioSeeder.test.ts @@ -367,6 +367,7 @@ describeDb('scenario database seed', () => { }, preopenAt: new Date('2030-01-01T01:00:00Z'), openAt: new Date('2030-01-01T02:00:00Z'), + serverName: '훼', }, }); @@ -400,6 +401,7 @@ describeDb('scenario database seed', () => { (worldState.currentYear - (scenario.startYear ?? worldState.currentYear) + 10) * 2 ); expect(meta.killturn).toBe(1600); + expect(meta.serverName).toBe('훼'); const autorun = (meta.autorun_user ?? {}) as Record; const autorunOptions = (autorun.options ?? {}) as Record; expect(autorunOptions.develop).toBe(true); diff --git a/app/game-engine/test/unificationPersistence.test.ts b/app/game-engine/test/unificationPersistence.test.ts index e180fad9..f1b89d1c 100644 --- a/app/game-engine/test/unificationPersistence.test.ts +++ b/app/game-engine/test/unificationPersistence.test.ts @@ -260,7 +260,12 @@ describe('persistUnificationFinalization', () => { expect(hallCreate).toHaveBeenCalledWith( expect.objectContaining({ data: expect.objectContaining({ - aux: expect.objectContaining({ ownerDisplayName: '표시 이름', fgColor: '#000000' }), + aux: expect.objectContaining({ + ownerDisplayName: '표시 이름', + fgColor: '#000000', + serverName: '테스트', + serverIdx: 2, + }), }), }) ); @@ -279,7 +284,10 @@ describe('persistUnificationFinalization', () => { ); expect(emperorCreate).toHaveBeenCalledWith( expect.objectContaining({ - data: expect.objectContaining({ aux: { winnerNationId: 1, generationKey: input.generationKey } }), + data: expect.objectContaining({ + phase: '테스트2기', + aux: { winnerNationId: 1, generationKey: input.generationKey }, + }), }) ); const archiveWrite = oldGeneralUpsert.mock.calls[0]?.[0] as { diff --git a/app/gateway-api/src/adminRouter.ts b/app/gateway-api/src/adminRouter.ts index 4307d71a..ff99494a 100644 --- a/app/gateway-api/src/adminRouter.ts +++ b/app/gateway-api/src/adminRouter.ts @@ -27,7 +27,11 @@ import type { GatewayApiContext } from './context.js'; import { resolveLocalAccountProfilePolicy } from './auth/localAccountPolicy.js'; import { GATEWAY_BUILD_STATUSES, GATEWAY_PROFILE_STATUSES } from './orchestrator/profileRepository.js'; import { readProfileReleaseSource } from './orchestrator/profileReleaseSource.js'; -import { orderGatewayProfiles, resolveGatewayProfileKoreanName } from './profileOrder.js'; +import { + orderGatewayProfiles, + resolveGatewayProfileDisplayName, + resolveGatewayProfileKoreanName, +} from './profileOrder.js'; import { purifyGatewayNoticeHtml } from './security/gatewayNoticeHtml.js'; const zProfileStatus = z.enum(GATEWAY_PROFILE_STATUSES); @@ -650,7 +654,25 @@ export const adminRouter = router({ }) .optional() ) - .query(({ ctx, input }) => (ctx as GatewayApiContext).adminAudit.list(input)), + .query(async ({ ctx, input }) => { + const gatewayCtx = ctx as GatewayApiContext; + const [events, profiles] = await Promise.all([ + gatewayCtx.adminAudit.list(input), + gatewayCtx.profiles.listProfiles(), + ]); + const displayNames = new Map( + profiles.map((profile) => [ + profile.profileName, + resolveGatewayProfileDisplayName(profile.profile, profile.instanceKey, profile.meta.korName), + ]) + ); + return events.map((event) => ({ + ...event, + ...(event.profileName && displayNames.has(event.profileName) + ? { profileDisplayName: displayNames.get(event.profileName) } + : {}), + })); + }), }), system: router({ getNotice: adminProcedure.query(async ({ ctx }) => { @@ -760,6 +782,13 @@ export const adminRouter = router({ specialAccessGrants, profiles: profiles.map((profile) => ({ profileName: profile.profileName, + profile: profile.profile, + instanceKey: profile.instanceKey, + displayName: resolveGatewayProfileDisplayName( + profile.profile, + profile.instanceKey, + profile.meta.korName + ), ...resolveLocalAccountProfilePolicy({ profile: profile.profile, profileName: profile.profileName, @@ -1727,6 +1756,11 @@ export const adminRouter = router({ profileName: profile.profileName, profile: profile.profile, instanceKey: profile.instanceKey, + displayName: resolveGatewayProfileDisplayName( + profile.profile, + profile.instanceKey, + profile.meta.korName + ), currentScenario: profile.currentScenario, meta: { korName: resolveGatewayProfileKoreanName(profile.profile, profile.meta.korName), @@ -1771,6 +1805,11 @@ export const adminRouter = router({ const runtimeSettingsMap = new Map(runtimeSettings.map((settings) => [settings.profileName, settings])); return profiles.map((profile) => ({ ...profile, + displayName: resolveGatewayProfileDisplayName( + profile.profile, + profile.instanceKey, + profile.meta.korName + ), runtimeActions: runtimeActionsByProfile.get(profile.profileName) ?? [], runtimeSettings: runtimeSettingsMap.get(profile.profileName) ?? null, activeOperation: activeOperationByProfile.get(profile.profileName) ?? null, @@ -1805,7 +1844,7 @@ export const adminRouter = router({ if (sourceMode === 'CURRENT') { if (!input?.profileName) { if (!adminAuth.isSuperuser) { - throw new TRPCError({ code: 'BAD_REQUEST', message: 'profileName is required.' }); + throw new TRPCError({ code: 'BAD_REQUEST', message: '대상 서버를 선택해야 합니다.' }); } } else { assertPermission(adminAuth, ROLE_ADMIN_SCENARIO_RESET, input.profileName); diff --git a/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts b/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts index 522f1021..b541f0af 100644 --- a/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts +++ b/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts @@ -23,6 +23,7 @@ import { import { isRecord } from '@sammo-ts/common'; import { resolveGatewayPostgresConfigFromEnv } from '../gatewayPostgresConfig.js'; +import { resolveGatewayProfileDisplayName, resolveGatewayProfileKoreanName } from '../profileOrder.js'; import { buildTurboReleaseCommand, @@ -281,6 +282,13 @@ const buildServerId = (profileName: string, now: Date, installOperationId?: stri return `${profileName}_${year}${month}${day}_${suffix}`; }; +export const resolveProfileArchiveServerName = ( + profile: Pick +): string => { + const meta = normalizeMeta(profile.meta); + return resolveGatewayProfileKoreanName(profile.profile, meta.korName); +}; + const readMetaNumber = (meta: Record, key: string): number | null => { const raw = meta[key]; if (typeof raw === 'number' && Number.isFinite(raw)) { @@ -1618,7 +1626,11 @@ export class GatewayOrchestrator implements GatewayOrchestratorHandle { this.processConfig.workspaceRoot )), ]; - await this.appendOperationLog(operationId, 'build', `${profile.profileName} 구성 요소를 빌드합니다.`); + await this.appendOperationLog( + operationId, + 'build', + `${resolveGatewayProfileDisplayName(profile.profile, profile.instanceKey, profile.meta.korName)} 구성 요소를 빌드합니다.` + ); const result = await this.releaseBuildRunner.run(commands, this.buildProgress(operationId, 'build'), { signal: this.activeOperationAbortSignal, }); @@ -2010,6 +2022,9 @@ export class GatewayOrchestrator implements GatewayOrchestratorHandle { season, firstGameIdx, serverId, + // Snapshot the Gateway display name into this season. Hall and + // dynasty archives must not fall back to the runtime instance key. + serverName: resolveProfileArchiveServerName(profile), installCommitSha: commitSha, }, adminUser, @@ -2222,7 +2237,11 @@ export class GatewayOrchestrator implements GatewayOrchestratorHandle { await this.appendOperationLog( operationId, 'build', - `${profile?.profileName ?? 'profile'} 구성 요소를 빌드합니다.` + `${ + profile + ? resolveGatewayProfileDisplayName(profile.profile, profile.instanceKey, profile.meta.korName) + : '대상 서버' + } 구성 요소를 빌드합니다.` ); } return { @@ -2424,7 +2443,13 @@ export class GatewayOrchestrator implements GatewayOrchestratorHandle { private async stageStaticProfileFrontend(profile: GatewayProfileRecord): Promise { if (!profile.buildCommitSha) { - throw new Error(`Profile ${profile.profileName} is missing the build commit SHA.`); + throw new Error( + `${resolveGatewayProfileDisplayName( + profile.profile, + profile.instanceKey, + profile.meta.korName + )} 서버의 build commit SHA가 없습니다.` + ); } const runtimeWorkspace = profile.buildWorkspace ?? this.processConfig.workspaceRoot; const sharedSourceRoot = buildSharedProfileFrontendOutDir(runtimeWorkspace); diff --git a/app/gateway-api/src/profileOrder.ts b/app/gateway-api/src/profileOrder.ts index 0a86a710..236b8401 100644 --- a/app/gateway-api/src/profileOrder.ts +++ b/app/gateway-api/src/profileOrder.ts @@ -20,6 +20,19 @@ export const resolveGatewayProfileKoreanName = (profile: string, configuredName? return gatewayProfileKoreanNames.get(profile) ?? profile; }; +/** + * User-facing profile label. The immutable profileName (`che:default`) remains + * an internal routing/storage key and must not leak into ordinary UI copy. + */ +export const resolveGatewayProfileDisplayName = ( + profile: string, + instanceKey: string, + configuredName?: unknown +): string => { + const koreanName = resolveGatewayProfileKoreanName(profile, configuredName); + return instanceKey === 'default' ? koreanName : `${koreanName} [${instanceKey}]`; +}; + const compareGatewayProfiles = ( left: { profile: string; instanceKey: string }, right: { profile: string; instanceKey: string } diff --git a/app/gateway-api/src/webPush/coordinator.ts b/app/gateway-api/src/webPush/coordinator.ts index 25759d4b..dbea569a 100644 --- a/app/gateway-api/src/webPush/coordinator.ts +++ b/app/gateway-api/src/webPush/coordinator.ts @@ -10,6 +10,8 @@ import { import { GatewayPrisma, type GatewayPrismaClient } from '@sammo-ts/infra'; import webPush from 'web-push'; +import { resolveGatewayProfileDisplayName } from '../profileOrder.js'; + export interface WebPushCoordinatorConfig { enabled: boolean; vapidSubject?: string; @@ -104,7 +106,14 @@ export class WebPushCoordinator { const [profiles, preferences, subscriptionCount, currentSubscription] = await Promise.all([ this.prisma.gatewayProfile.findMany({ orderBy: [{ profile: 'asc' }, { instanceKey: 'asc' }], - select: { profileName: true, profile: true, currentScenario: true, status: true }, + select: { + profileName: true, + profile: true, + instanceKey: true, + currentScenario: true, + status: true, + meta: true, + }, }), this.prisma.webPushPreference.findMany({ where: { userId }, @@ -128,7 +137,15 @@ export class WebPushCoordinator { capability: this.getCapability(), eventTypes: WEB_PUSH_EVENT_TYPES, profiles: profiles.map((profile) => ({ - ...profile, + profileName: profile.profileName, + profile: profile.profile, + instanceKey: profile.instanceKey, + displayName: resolveGatewayProfileDisplayName( + profile.profile, + profile.instanceKey, + (profile.meta as Record | null)?.korName + ), + currentScenario: profile.currentScenario, status: String(profile.status), })), preferences: preferences.filter((preference) => isWebPushEventType(preference.eventType)), @@ -218,7 +235,7 @@ export class WebPushCoordinator { if (!this.configured) return false; const profile = await tx.gatewayProfile.findUnique({ where: { profileName: event.profileName }, - select: { profile: true, profileName: true }, + select: { profile: true, profileName: true, instanceKey: true, meta: true }, }); if (!profile) return false; const receipt = await tx.webPushEventReceipt.createMany({ @@ -258,7 +275,16 @@ export class WebPushCoordinator { ids.push(subscription.id); subscriptionIdsByUser.set(subscription.userId, ids); } - const copy = copyFor(event.eventType, profile.profile, event.year, event.month); + const copy = copyFor( + event.eventType, + resolveGatewayProfileDisplayName( + profile.profile, + profile.instanceKey, + (profile.meta as Record | null)?.korName + ), + event.year, + event.month + ); for (const userId of selectedUserIds) { const subscriptionIds = subscriptionIdsByUser.get(userId) ?? []; if (subscriptionIds.length === 0) continue; @@ -395,10 +421,7 @@ export class WebPushCoordinator { }); for (const delivery of claimed) { - if ( - delivery.subscription.expirationTime && - delivery.subscription.expirationTime.getTime() <= Date.now() - ) { + if (delivery.subscription.expirationTime && delivery.subscription.expirationTime.getTime() <= Date.now()) { await this.prisma.$transaction(async (tx) => { await tx.webPushDelivery.updateMany({ where: { id: delivery.id, lockOwner: this.owner }, @@ -445,11 +468,15 @@ export class WebPushCoordinator { typeof error === 'object' && error !== null && 'statusCode' in error ? Number((error as { statusCode?: unknown }).statusCode) : 0; - const terminal = statusCode === 404 || statusCode === 410 || (statusCode >= 400 && statusCode < 500 && statusCode !== 429); + const terminal = + statusCode === 404 || + statusCode === 410 || + (statusCode >= 400 && statusCode < 500 && statusCode !== 429); const attempts = delivery.attempts; const exhausted = attempts >= 8; const delaySeconds = Math.min(300, 2 ** Math.min(attempts, 8)); - const safeError = statusCode > 0 ? `Push service returned HTTP ${statusCode}.` : 'Push service request failed.'; + const safeError = + statusCode > 0 ? `Push service returned HTTP ${statusCode}.` : 'Push service request failed.'; await this.prisma.$transaction(async (tx) => { await tx.webPushDelivery.updateMany({ where: { id: delivery.id, lockOwner: this.owner }, diff --git a/app/gateway-api/test/adminOperations.test.ts b/app/gateway-api/test/adminOperations.test.ts index 1c35892d..b466c631 100644 --- a/app/gateway-api/test/adminOperations.test.ts +++ b/app/gateway-api/test/adminOperations.test.ts @@ -380,6 +380,7 @@ describe('admin profile navigation API', () => { profileName: 'che:2', profile: 'che', instanceKey: '2', + displayName: '체 [2]', currentScenario: '2', meta: { korName: '체' }, }, diff --git a/app/gateway-api/test/orchestratorPlan.test.ts b/app/gateway-api/test/orchestratorPlan.test.ts index 5ee3535e..60cc4069 100644 --- a/app/gateway-api/test/orchestratorPlan.test.ts +++ b/app/gateway-api/test/orchestratorPlan.test.ts @@ -9,6 +9,7 @@ import { buildSharedProfileFrontendCommands, buildWorkspaceCommands, planProfileReconcile, + resolveProfileArchiveServerName, resolveResetLifecycleStatus, } from '../src/orchestrator/gatewayOrchestrator.js'; import { GATEWAY_PROFILE_ORDER } from '../src/profileOrder.js'; @@ -134,6 +135,30 @@ describe('resolveResetLifecycleStatus', () => { }); }); +describe('resolveProfileArchiveServerName', () => { + it('uses the configured Gateway name and never the runtime instance key', () => { + expect( + resolveProfileArchiveServerName({ + ...buildProfile(), + profile: 'hwe', + profileName: 'hwe:default', + meta: { korName: ' 훼 ' }, + }) + ).toBe('훼'); + }); + + it('uses the canonical profile label when Gateway has no override', () => { + expect( + resolveProfileArchiveServerName({ + ...buildProfile(), + profile: 'hwe', + profileName: 'hwe:default', + meta: {}, + }) + ).toBe('훼'); + }); +}); + describe('buildProcessDefinitions', () => { const processConfig = { workspaceRoot: '/srv/sammo/main', diff --git a/app/gateway-api/test/profileOrder.test.ts b/app/gateway-api/test/profileOrder.test.ts index 8dd710b4..35b12ba1 100644 --- a/app/gateway-api/test/profileOrder.test.ts +++ b/app/gateway-api/test/profileOrder.test.ts @@ -4,6 +4,7 @@ import { GATEWAY_PROFILE_KOREAN_NAMES, GATEWAY_PROFILE_ORDER, orderGatewayProfiles, + resolveGatewayProfileDisplayName, resolveGatewayProfileKoreanName, } from '../src/profileOrder.js'; @@ -56,3 +57,12 @@ describe('resolveGatewayProfileKoreanName', () => { expect(resolveGatewayProfileKoreanName('custom')).toBe('custom'); }); }); + +describe('resolveGatewayProfileDisplayName', () => { + it('hides the default instance key and distinguishes non-default instances', () => { + expect(resolveGatewayProfileDisplayName('che', 'default')).toBe('체'); + expect(resolveGatewayProfileDisplayName('hwe', '2')).toBe('훼 [2]'); + expect(resolveGatewayProfileDisplayName('che', 'default', ' 천하서버 ')).toBe('천하서버'); + expect(resolveGatewayProfileDisplayName('custom', 'blue')).toBe('custom [blue]'); + }); +}); diff --git a/app/gateway-api/test/scenarioCatalog.test.ts b/app/gateway-api/test/scenarioCatalog.test.ts index 6e10874a..eefe56be 100644 --- a/app/gateway-api/test/scenarioCatalog.test.ts +++ b/app/gateway-api/test/scenarioCatalog.test.ts @@ -3,6 +3,16 @@ import { describe, expect, it } from 'vitest'; import { listScenarioPreviews, resolveGitCommitSha } from '../src/scenario/scenarioCatalog.js'; describe('scenarioCatalog git ref support', () => { + it('includes the CHE zero-season dawn scenario in the local catalog', async () => { + const previews = await listScenarioPreviews(); + + expect(previews.find((scenario) => scenario.id === 916)).toMatchObject({ + id: 916, + title: '【공백지】 여명', + year: 180, + }); + }); + it('resolves HEAD to a commit hash', async () => { const commitSha = await resolveGitCommitSha('HEAD'); expect(commitSha).toMatch(/^[0-9a-f]{40}$/i); @@ -18,6 +28,11 @@ describe('scenarioCatalog git ref support', () => { expect(previews.every((scenario) => scenario.fiction === null || Number.isInteger(scenario.fiction))).toBe( true ); + expect(previews.find((scenario) => scenario.id === 916)).toMatchObject({ + id: 916, + title: '【공백지】 여명', + year: 180, + }); }); it('rejects without crashing when git cannot be spawned', async () => { diff --git a/app/gateway-frontend/e2e/admin-account-controls.spec.ts b/app/gateway-frontend/e2e/admin-account-controls.spec.ts index cdb45e28..b2ac3bd1 100644 --- a/app/gateway-frontend/e2e/admin-account-controls.spec.ts +++ b/app/gateway-frontend/e2e/admin-account-controls.spec.ts @@ -131,6 +131,9 @@ const installFixture = async (page: Page) => { profiles: [ { profileName: 'che:default', + profile: 'che', + instanceKey: 'default', + displayName: '체', requiresKakaoVerification: true, kakaoVerified: false, accessAllowed: true, @@ -219,15 +222,16 @@ test('operates OAuth grace and scheduled deletion with reasoned audit history', await page.getByRole('button', { name: /접근 · 권한/ }).click(); await expect(page.getByRole('option', { name: /Profile 전체 운영/ })).toHaveCount(0); await expect(page.getByRole('option', { name: /Profile 실행 관리/ })).toHaveCount(1); - await expect(page.getByRole('cell', { name: 'che:default' })).toBeVisible(); + await expect(page.getByRole('cell', { name: '체' })).toBeVisible(); + await expect(page.getByText('che:default', { exact: true })).toHaveCount(0); await page.screenshot({ path: testInfo.outputPath('gateway-admin-account-controls-desktop.png'), fullPage: true }); await page.getByPlaceholder('권한·제재·복구·탈퇴 조치 사유 (필수)').fill('본인 확인 처리 중'); await page.getByLabel('특수 접근 만료 시각').fill('2026-08-20T00:00'); - await page.getByPlaceholder('che 또는 che:2 (쉼표 구분, 비우면 전체)').fill('che'); + await page.getByRole('checkbox', { name: '체' }).check(); await page.getByPlaceholder('권한·제재·복구·탈퇴 조치 사유 (필수)').fill('휴대폰 분실 임시 복구'); await page.getByRole('button', { name: '특수 접근 부여', exact: true }).click(); await expect(page.getByText('특수 접근 자격을 부여했습니다.').first()).toBeVisible(); - await expect(page.getByText(/RECOVERY · che/)).toBeVisible(); + await expect(page.getByText(/RECOVERY · 체/)).toBeVisible(); await page.screenshot({ path: testInfo.outputPath('gateway-admin-special-access-granted.png'), fullPage: true }); const gracePanel = page.getByRole('heading', { name: 'Kakao 인증 유예' }).locator('..'); diff --git a/app/gateway-frontend/e2e/admin-runtime-actions.spec.ts b/app/gateway-frontend/e2e/admin-runtime-actions.spec.ts index 7c27a78b..8ec646c3 100644 --- a/app/gateway-frontend/e2e/admin-runtime-actions.spec.ts +++ b/app/gateway-frontend/e2e/admin-runtime-actions.spec.ts @@ -165,6 +165,7 @@ const installFixture = async ( profileName: 'hwe:default', profile: 'hwe', instanceKey: 'default', + displayName: '훼', currentScenario: options.currentScenario === undefined ? '1010' : options.currentScenario, meta: {}, }, @@ -177,6 +178,7 @@ const installFixture = async ( profileName: 'hwe:default', profile: 'hwe', instanceKey: 'default', + displayName: '훼', currentScenario: options.currentScenario === undefined ? '1010' : options.currentScenario, scenario: options.currentScenario ?? 'default', apiPort: 15015, @@ -542,7 +544,7 @@ test('directs profile deployment to the selected server version tab', async ({ p const tabAndHeaderGeometry = await Promise.all([ tabs.evaluate((element) => element.getBoundingClientRect().top), page - .getByText('서버 ID: hwe:default · 인스턴스: default', { exact: true }) + .getByText('현재 시나리오: 1010', { exact: true }) .evaluate((element) => element.getBoundingClientRect().top), ]); expect(tabAndHeaderGeometry[0]).toBeLessThan(tabAndHeaderGeometry[1]); diff --git a/app/gateway-frontend/e2e/general-icon-lifecycle.spec.ts b/app/gateway-frontend/e2e/general-icon-lifecycle.spec.ts index 461fd81a..6bf08071 100644 --- a/app/gateway-frontend/e2e/general-icon-lifecycle.spec.ts +++ b/app/gateway-frontend/e2e/general-icon-lifecycle.spec.ts @@ -34,15 +34,20 @@ const resetScenario = async (page: Page, scenarioId: string, sourceCommit: strin await expect(page.getByText(/개 시나리오를 확인했습니다/)).toBeVisible(); await page.getByTestId('scenario-select').selectOption(scenarioId); - const latestOperation = page.getByTestId('operations-table').locator('tbody tr').first(); + const latestOperation = page.getByTestId('operation-summary-row').first(); const previousLatestOperation = await latestOperation.textContent(); await page.getByTestId('request-reset').click(); await expect(page.getByText('초기화 작업을 시작했습니다.')).toBeVisible(); await expect.poll(() => latestOperation.textContent(), { timeout: 15_000 }).not.toBe(previousLatestOperation); - await expect(latestOperation).toContainText(sourceCommit, { timeout: 15_000 }); - await expect(latestOperation.locator('td').nth(3)).toHaveText('SUCCEEDED', { - timeout: 300_000, - }); + await latestOperation.getByTestId('operation-details-toggle').click(); + await expect(page.getByTestId('operation-detail').first()).toContainText(sourceCommit, { timeout: 15_000 }); + await expect(latestOperation.locator('[data-operation-status]')).toHaveAttribute( + 'data-operation-status', + 'SUCCEEDED', + { + timeout: 300_000, + } + ); const profileStatus = page.getByTestId('selected-profile-status'); await expect(profileStatus.locator(':scope > div').nth(0)).toContainText('RUNNING', { timeout: 30_000, diff --git a/app/gateway-frontend/e2e/hwe-lifecycle.spec.ts b/app/gateway-frontend/e2e/hwe-lifecycle.spec.ts index 48cb8287..069e3149 100644 --- a/app/gateway-frontend/e2e/hwe-lifecycle.spec.ts +++ b/app/gateway-frontend/e2e/hwe-lifecycle.spec.ts @@ -95,7 +95,7 @@ test('admin resets and opens hwe, then two users create generals and reach main' await page.getByTestId('load-scenarios').click(); await expect(page.getByText(/개 시나리오를 확인했습니다/)).toBeVisible(); await page.getByTestId('scenario-select').selectOption(scenarioId); - const latestOperation = page.getByTestId('operations-table').locator('tbody tr').first(); + const latestOperation = page.getByTestId('operation-summary-row').first(); const previousLatestOperation = await latestOperation.textContent(); await page.getByTestId('request-reset').click(); await expect(page.getByText('초기화 작업을 등록했습니다.').first()).toBeVisible(); @@ -105,12 +105,17 @@ test('admin resets and opens hwe, then two users create generals and reach main' timeout: 15_000, }) .not.toBe(previousLatestOperation); - await expect(latestOperation).toContainText(sourceCommit, { + await latestOperation.getByTestId('operation-details-toggle').click(); + await expect(page.getByTestId('operation-detail').first()).toContainText(sourceCommit, { timeout: 15_000, }); - await expect(latestOperation.locator('td').nth(4)).toHaveText('SUCCEEDED', { - timeout: 300_000, - }); + await expect(latestOperation.locator('[data-operation-status]')).toHaveAttribute( + 'data-operation-status', + 'SUCCEEDED', + { + timeout: 300_000, + } + ); } await expect(profileStatus).toContainText('RUNNING', { timeout: 30_000 }); await expect(profileStatus).toContainText('SUCCEEDED'); diff --git a/app/gateway-frontend/e2e/lobby-admin-navigation.spec.ts b/app/gateway-frontend/e2e/lobby-admin-navigation.spec.ts index d3ae7b0c..7d4b39dd 100644 --- a/app/gateway-frontend/e2e/lobby-admin-navigation.spec.ts +++ b/app/gateway-frontend/e2e/lobby-admin-navigation.spec.ts @@ -48,6 +48,7 @@ const installGatewayFixture = async (page: Page, roles: string[]) => { profileName: 'hwe:2', profile: 'hwe', instanceKey: '2', + displayName: '환상서버 [2]', currentScenario: '1010', scenario: '1010', status: 'RUNNING', @@ -68,6 +69,7 @@ const installGatewayFixture = async (page: Page, roles: string[]) => { profileName: 'hwe:2', profile: 'hwe', instanceKey: '2', + displayName: '환상서버 [2]', currentScenario: '1010', meta: { korName: '환상서버' }, }, @@ -306,23 +308,26 @@ test('keeps mobile account actions on clean rows for users and administrators', const adminLink = adminPage.getByRole('link', { name: '관리자 페이지' }); const baseBackground = await adminLink.evaluate((element) => getComputedStyle(element).backgroundColor); await adminLink.hover(); - await expect.poll(() => adminLink.evaluate((element) => getComputedStyle(element).backgroundColor)).not.toBe( - baseBackground - ); + await expect + .poll(() => adminLink.evaluate((element) => getComputedStyle(element).backgroundColor)) + .not.toBe(baseBackground); await adminLink.focus(); await expect(adminLink).toBeFocused(); - await adminPage.screenshot({ path: testInfo.outputPath('gateway-account-actions-admin-500px.png'), fullPage: true }); + await adminPage.screenshot({ + path: testInfo.outputPath('gateway-account-actions-admin-500px.png'), + fullPage: true, + }); await adminPage.setViewportSize({ width: 390, height: 844 }); const adminNarrowGeometry = await measureAccountActions(adminPage); expect(adminNarrowGeometry.documentWidth).toBe(adminNarrowGeometry.viewportWidth); expect(adminNarrowGeometry.items[0]?.top).toBeCloseTo(adminNarrowGeometry.items[1]?.top ?? 0, 0); - expect(adminNarrowGeometry.items[2]?.top).toBeCloseTo( - (adminNarrowGeometry.items[1]?.bottom ?? 0) + 16, - 0 - ); + expect(adminNarrowGeometry.items[2]?.top).toBeCloseTo((adminNarrowGeometry.items[1]?.bottom ?? 0) + 16, 0); expect(adminNarrowGeometry.items.every(({ scrollWidth, clientWidth }) => scrollWidth <= clientWidth)).toBe(true); - await adminPage.screenshot({ path: testInfo.outputPath('gateway-account-actions-admin-390px.png'), fullPage: true }); + await adminPage.screenshot({ + path: testInfo.outputPath('gateway-account-actions-admin-390px.png'), + fullPage: true, + }); await adminPage.setViewportSize({ width: 360, height: 800 }); const adminSmallGeometry = await measureAccountActions(adminPage); diff --git a/app/gateway-frontend/e2e/server-operations.spec.ts b/app/gateway-frontend/e2e/server-operations.spec.ts index f48a20e2..cdbdf58d 100644 --- a/app/gateway-frontend/e2e/server-operations.spec.ts +++ b/app/gateway-frontend/e2e/server-operations.spec.ts @@ -71,6 +71,7 @@ const profile = (runtimeRunning: boolean, resetDefaults?: Record ({ result: { data } }); @@ -190,6 +201,7 @@ const installFixture = async (page: Page, state: FixtureState) => { profileName: 'che:default', profile: 'che', instanceKey: 'default', + displayName: '천하서버', currentScenario: '2', meta: { korName: '천하서버' }, }, @@ -538,6 +550,7 @@ test('separates branch and commit semantics and submits a reset from the dedicat await expect(page.getByTestId('scenario-select')).toHaveValue('2'); await expect(page.getByTestId('request-reset')).toBeEnabled(); await expect(page.getByTestId('scenario-select').locator('option:checked')).toContainText('현재 시나리오'); + await expect(page.getByTestId('scenario-select').locator('option[value="916"]')).toContainText('【공백지】 여명'); const catalogGeometry = await page.getByTestId('scenario-select').evaluate((select) => { const scenarioSelect = select as HTMLSelectElement; const rect = select.getBoundingClientRect(); @@ -550,7 +563,7 @@ test('separates branch and commit semantics and submits a reset from the dedicat value: scenarioSelect.value, }; }); - expect(catalogGeometry.optionCount).toBe(3); + expect(catalogGeometry.optionCount).toBe(4); expect(catalogGeometry.value).toBe('2'); expect(catalogGeometry.width).toBeGreaterThan(300); await page.screenshot({ path: testInfo.outputPath('current-scenario-catalog.png'), fullPage: true }); @@ -626,47 +639,60 @@ test('separates branch and commit semantics and submits a reset from the dedicat await page.getByTestId('request-reset').click(); await expect(page.getByText('초기화 작업을 등록했습니다.').first()).toBeVisible(); - await expect(page.getByTestId('operations-table')).toContainText('RESET'); + await expect(page.getByTestId('operations-table')).toContainText('시나리오 초기화'); await expect(page.getByTestId('profile-operation-log-panel')).toBeVisible(); - await expect(page.getByTestId('profile-operation-log')).toContainText('che:default 구성 요소를 빌드합니다.'); + await expect(page.getByTestId('profile-operation-log')).toContainText('천하서버 구성 요소를 빌드합니다.'); await expect(page.getByTestId('profile-operation-log')).toContainText('시나리오 초기 데이터 생성을 완료했습니다.'); await expect(page.getByTestId('profile-operation-log-status')).toContainText('SUCCEEDED'); + const operationTable = page.getByTestId('operations-table'); + await expect(operationTable.getByRole('columnheader')).toHaveText(['요청 · 작업', '상태', '보기']); + await expect(operationTable.getByText('시나리오 초기화', { exact: true })).toBeVisible(); + await expect(operationTable.getByText('완료', { exact: true })).toBeVisible(); + await expect(operationTable.getByText('che:default', { exact: true })).toBeHidden(); + const detailsToggle = operationTable.getByTestId('operation-details-toggle'); + await expect(detailsToggle).toHaveAttribute('aria-expanded', 'false'); + await detailsToggle.click(); + await expect(detailsToggle).toHaveAttribute('aria-expanded', 'true'); + const operationDetail = operationTable.getByTestId('operation-detail'); + await expect(operationDetail).toContainText('천하서버'); + await expect(operationDetail).not.toContainText('che:default'); + await expect(operationDetail).toContainText('0123456789abcdef0123456789abcdef01234567'); + await expect(operationDetail).toContainText('admin'); const operationTableGeometry = await page.getByTestId('operations-table').evaluate((table) => { const columnWidths = Array.from(table.querySelectorAll('thead th')).map( (heading) => heading.getBoundingClientRect().width ); - const rowHeight = table.querySelector('tbody tr')?.getBoundingClientRect().height ?? 0; + const summaryRowHeight = table + .querySelector('[data-testid="operation-summary-row"]') + ?.getBoundingClientRect().height; return { columnWidths, - rowHeight, + summaryRowHeight, tableWidth: table.getBoundingClientRect().width, scrollerWidth: table.parentElement?.getBoundingClientRect().width ?? 0, + scrollerScrollWidth: table.parentElement?.scrollWidth ?? 0, tableLayout: getComputedStyle(table).tableLayout, }; }); const sourceRefGeometry = await page.getByTestId('operation-source-ref').evaluate((element) => { const style = getComputedStyle(element); return { - title: element.getAttribute('title'), + text: element.textContent?.trim(), overflow: style.overflow, - textOverflow: style.textOverflow, whiteSpace: style.whiteSpace, }; }); expect(operationTableGeometry.tableLayout).toBe('fixed'); - expect(operationTableGeometry.tableWidth).toBeGreaterThanOrEqual(1_300); - expect(operationTableGeometry.tableWidth).toBeGreaterThan(operationTableGeometry.scrollerWidth); - expect(operationTableGeometry.columnWidths[0]).toBeGreaterThanOrEqual(159); - expect(operationTableGeometry.columnWidths[1]).toBeGreaterThanOrEqual(263); - expect(operationTableGeometry.columnWidths[5]).toBeLessThanOrEqual(113); - expect(operationTableGeometry.columnWidths[7]).toBeGreaterThanOrEqual(175); - expect(operationTableGeometry.columnWidths[1]).toBeGreaterThan(operationTableGeometry.columnWidths[5]! * 2); - expect(operationTableGeometry.rowHeight).toBeLessThanOrEqual(50); + expect(operationTableGeometry.columnWidths).toHaveLength(3); + expect(operationTableGeometry.tableWidth).toBeLessThanOrEqual(operationTableGeometry.scrollerWidth + 1); + expect(operationTableGeometry.scrollerScrollWidth).toBeLessThanOrEqual(operationTableGeometry.scrollerWidth + 1); + expect(operationTableGeometry.columnWidths[0]).toBeGreaterThan(operationTableGeometry.columnWidths[1]!); + expect(operationTableGeometry.columnWidths[2]).toBeGreaterThan(operationTableGeometry.columnWidths[1]!); + expect(operationTableGeometry.summaryRowHeight).toBeLessThanOrEqual(90); expect(sourceRefGeometry).toEqual({ - title: '0123456789abcdef0123456789abcdef01234567', - overflow: 'hidden', - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', + text: 'COMMIT 0123456789abcdef0123456789abcdef01234567', + overflow: 'visible', + whiteSpace: 'normal', }); await writeFile( testInfo.outputPath('operation-table-metrics.json'), @@ -682,7 +708,7 @@ test('separates branch and commit semantics and submits a reset from the dedicat expect(JSON.stringify(resetRequest?.body)).toContain('"openAt":"2030-08-13T02:00:00.000Z"'); await page.screenshot({ path: testInfo.outputPath('reset-operation-log-desktop.png'), fullPage: true }); - await page.setViewportSize({ width: 390, height: 844 }); + await page.setViewportSize({ width: 500, height: 844 }); const mobileGeometry = await page .getByTestId('server-operations-page') .locator('section') @@ -694,7 +720,7 @@ test('separates branch and commit semantics and submits a reset from the dedicat }); return children; }); - expect(mobileGeometry[0]!.width).toBeLessThanOrEqual(390); + expect(mobileGeometry[0]!.width).toBeLessThanOrEqual(500); const mobilePublishGeometry = await publishSchedule.evaluate((element) => { const label = element.closest('label'); if (!label) throw new Error('expected publish schedule label'); @@ -724,18 +750,21 @@ test('separates branch and commit semantics and submits a reset from the dedicat const mobileOperationTableGeometry = await page.getByTestId('operations-table').evaluate((table) => { const scroller = table.parentElement!; const scrollerRect = scroller.getBoundingClientRect(); + const detailRect = table.querySelector('[data-testid="operation-detail"]')?.getBoundingClientRect(); return { tableWidth: table.getBoundingClientRect().width, scrollerX: scrollerRect.x, scrollerWidth: scrollerRect.width, scrollerScrollWidth: scroller.scrollWidth, + detailX: detailRect?.x, + detailRight: detailRect?.right, viewportWidth: document.documentElement.clientWidth, documentScrollWidth: document.documentElement.scrollWidth, }; }); - expect(mobileOperationTableGeometry.tableWidth).toBeGreaterThanOrEqual(1_300); - expect(mobileOperationTableGeometry.scrollerScrollWidth).toBeGreaterThan( - mobileOperationTableGeometry.scrollerWidth + expect(mobileOperationTableGeometry.tableWidth).toBeLessThanOrEqual(mobileOperationTableGeometry.scrollerWidth + 1); + expect(mobileOperationTableGeometry.scrollerScrollWidth).toBeLessThanOrEqual( + mobileOperationTableGeometry.scrollerWidth + 1 ); expect(mobileOperationTableGeometry.scrollerX).toBeGreaterThanOrEqual(0); expect(mobileOperationTableGeometry.scrollerX + mobileOperationTableGeometry.scrollerWidth).toBeLessThanOrEqual( @@ -744,6 +773,13 @@ test('separates branch and commit semantics and submits a reset from the dedicat expect(mobileOperationTableGeometry.documentScrollWidth).toBeLessThanOrEqual( mobileOperationTableGeometry.viewportWidth ); + expect(mobileOperationTableGeometry.detailX).toBeGreaterThanOrEqual(mobileOperationTableGeometry.scrollerX); + expect(mobileOperationTableGeometry.detailRight).toBeLessThanOrEqual( + mobileOperationTableGeometry.scrollerX + mobileOperationTableGeometry.scrollerWidth + ); + await page.screenshot({ path: testInfo.outputPath('mobile-operation-detail.png'), fullPage: true }); + await detailsToggle.click(); + await expect(operationDetail).toBeHidden(); await writeFile( testInfo.outputPath('operation-table-mobile-metrics.json'), JSON.stringify(mobileOperationTableGeometry, null, 2) @@ -772,9 +808,9 @@ test('separates DB-preserving profile deployment from DB reset', async ({ page } await page.getByTestId('request-deploy').click(); await expect(page.getByText('DB 보존 배포 작업을 등록했습니다.').first()).toBeVisible(); - await expect(page.getByTestId('operations-table')).toContainText('DEPLOY'); + await expect(page.getByTestId('operations-table')).toContainText('버전 업데이트'); await expect(page.getByTestId('profile-operation-log-panel')).toBeVisible(); - await expect(page.getByTestId('profile-operation-log')).toContainText('che:default 구성 요소를 빌드합니다.'); + await expect(page.getByTestId('profile-operation-log')).toContainText('천하서버 구성 요소를 빌드합니다.'); await expect(page.getByTestId('profile-operation-log')).toContainText('game-frontend build complete'); await expect(page.getByTestId('profile-operation-log-status')).toContainText('SUCCEEDED'); expect(state.requestBodies.some((entry) => entry.operation === 'admin.operations.requestDeploy')).toBe(true); @@ -801,7 +837,7 @@ test('submits a separately authorized destructive game cancellation on desktop a await page.goto('admin/servers/che%3Adefault/cancel'); await expect(page).toHaveURL(/\/gateway\/admin\/servers\/che%3Adefault\/cancel$/); - await expect(page.getByRole('heading', { name: 'che:default 게임 취소' })).toBeVisible(); + await expect(page.getByRole('heading', { name: '천하서버 게임 취소' })).toBeVisible(); await expect(page.getByRole('link', { name: '게임 취소', exact: true })).toHaveAttribute('aria-current', 'page'); await expect(page.getByRole('link', { name: '시나리오 초기화', exact: true })).toHaveCount(0); await expect(page.getByTestId('request-game-cancellation')).toBeDisabled(); @@ -810,7 +846,7 @@ test('submits a separately authorized destructive game cancellation on desktop a await page.getByTestId('cancellation-general-mode').selectOption('RETAIN'); await page.getByTestId('cancellation-retention-percent').fill('35'); await page.getByTestId('cancellation-reason').fill('잘못된 시나리오로 개장함'); - await page.getByTestId('cancellation-confirmation').fill('che:default'); + await page.getByTestId('cancellation-confirmation').fill('천하서버 게임 취소'); const cancelButton = page.getByTestId('request-game-cancellation'); await expect(cancelButton).toBeEnabled(); await cancelButton.hover(); @@ -837,7 +873,7 @@ test('submits a separately authorized destructive game cancellation on desktop a await cancelButton.click(); await expect(page.getByText('게임 취소 작업을 등록했습니다.').first()).toBeVisible(); - await expect(page.getByTestId('operations-table')).toContainText('CANCEL_GAME'); + await expect(page.getByTestId('operations-table')).toContainText('게임 취소'); expect(confirmations).toHaveLength(1); expect(confirmations[0]).toContain('기수 행 물리 삭제'); expect(confirmations[0]).toContain('장수 기록 보존'); @@ -1315,10 +1351,11 @@ test('renders the stable server identity without exposing the default suffix as const navigation = page.getByRole('navigation', { name: '관리자 메뉴' }); const profileLink = navigation.getByRole('link', { name: '천하서버' }); await expect(profileLink).toBeVisible({ timeout: 900 }); - await expect(profileLink).toHaveAttribute('title', '서버 ID: che:default'); + await expect(profileLink).toHaveAttribute('title', '천하서버 서버 관리'); await expect(navigation).not.toContainText('천하서버 (che:default)'); await expect(navigation.getByRole('link', { name: 'Gateway 릴리스' })).toBeVisible({ timeout: 900 }); - await expect(page.getByText('서버 ID: che:default · 인스턴스: default')).toBeVisible(); + await expect(page.getByText('서버 ID: che:default · 인스턴스: default')).toHaveCount(0); + await expect(page.getByText('천하서버', { exact: true })).toBeVisible(); await expect(page.getByText('현재 시나리오: 2')).toBeVisible(); await profileLink.focus(); const desktop = await profileLink.evaluate((element) => { @@ -1405,7 +1442,7 @@ test('stops a running profile build while keeping the existing runtime available await page.getByRole('button', { name: '빌드 중단' }).click(); await expect(page.getByText('프로필 빌드를 중단했습니다.').first()).toBeVisible(); - await expect(page.getByTestId('operations-table').getByText('CANCELLED', { exact: true })).toBeVisible(); + await expect(page.getByTestId('operations-table').getByText('중단됨', { exact: true })).toBeVisible(); expect(state.requestBodies.some((entry) => entry.operation === 'admin.operations.cancel')).toBe(true); }); @@ -1677,17 +1714,20 @@ test('renders a failed reset, retries it as a new operation, and reaches success page.on('dialog', (dialog) => dialog.accept()); await page.goto('admin/servers/che%3Adefault/scenario'); - await expect(page.getByTestId('operations-table').getByText('FAILED', { exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'fedcba987654', exact: true })).toBeVisible(); + const operationTable = page.getByTestId('operations-table'); + await expect(operationTable.getByText('실패', { exact: true })).toBeVisible(); + await expect(operationTable.getByText(longError)).toBeHidden(); + await operationTable.getByRole('button', { name: '오류 상세' }).click(); + await expect(operationTable.getByText('fedcba9876543210fedcba9876543210fedcba98', { exact: true })).toBeVisible(); const failure = page.getByTestId('operations-table').getByText(longError); await expect(failure).toBeVisible(); - expect(await failure.evaluate((element) => getComputedStyle(element).color)).toBe('oklch(0.704 0.191 22.216)'); + expect(await failure.evaluate((element) => getComputedStyle(element).color)).toBe('oklch(0.808 0.114 19.571)'); await page.getByRole('button', { name: '재시도' }).click(); await expect(page.getByText('재시도 작업을 등록했습니다.').first()).toBeVisible(); - await expect(page.getByTestId('operations-table').getByText('FAILED', { exact: true })).toBeVisible(); - await expect(page.getByTestId('operations-table').getByText('QUEUED', { exact: true })).toBeVisible(); - await expect(page.getByTestId('operations-table').locator('tbody tr')).toHaveCount(2); + await expect(page.getByTestId('operations-table').getByText('실패', { exact: true })).toBeVisible(); + await expect(page.getByTestId('operations-table').getByText('대기 중', { exact: true })).toBeVisible(); + await expect(page.getByTestId('operation-summary-row')).toHaveCount(2); state.operations[0] = { ...state.operations[0]!, @@ -1698,7 +1738,7 @@ test('renders a failed reset, retries it as a new operation, and reaches success }; state.runtimeRunning = true; await page.getByTestId('refresh-operations').click(); - await expect(page.getByTestId('operations-table').getByText('SUCCEEDED', { exact: true })).toBeVisible(); + await expect(page.getByTestId('operations-table').getByText('완료', { exact: true })).toBeVisible(); await expect(page.getByText('운영 프로필', { exact: true })).toHaveCount(0); await page.screenshot({ path: testInfo.outputPath('failed-retry-succeeded-desktop.png'), fullPage: true }); @@ -1706,8 +1746,14 @@ test('renders a failed reset, retries it as a new operation, and reaches success const tableGeometry = await page.getByTestId('operations-table').evaluate((table) => { const tableRect = table.getBoundingClientRect(); const scrollerRect = table.parentElement!.getBoundingClientRect(); - return { tableWidth: tableRect.width, scrollerWidth: scrollerRect.width }; + return { + tableWidth: tableRect.width, + scrollerWidth: scrollerRect.width, + documentScrollWidth: document.documentElement.scrollWidth, + viewportWidth: document.documentElement.clientWidth, + }; }); - expect(tableGeometry.tableWidth).toBeGreaterThan(tableGeometry.scrollerWidth); + expect(tableGeometry.tableWidth).toBeLessThanOrEqual(tableGeometry.scrollerWidth + 1); + expect(tableGeometry.documentScrollWidth).toBeLessThanOrEqual(tableGeometry.viewportWidth); await page.screenshot({ path: testInfo.outputPath('failed-retry-succeeded-mobile.png'), fullPage: true }); }); diff --git a/app/gateway-frontend/e2e/web-push-settings.spec.ts b/app/gateway-frontend/e2e/web-push-settings.spec.ts index e885531f..f32da536 100644 --- a/app/gateway-frontend/e2e/web-push-settings.spec.ts +++ b/app/gateway-frontend/e2e/web-push-settings.spec.ts @@ -59,6 +59,8 @@ const installFixture = async (page: Page) => { { profileName: 'hwe:default', profile: 'hwe', + instanceKey: 'default', + displayName: '훼', currentScenario: 'default', status: 'RUNNING', }, @@ -93,6 +95,8 @@ test('web push settings are default-off and remain configurable while delivery i const table = page.locator('#notification-table'); await expect(table).toBeVisible(); await expect(table).toContainText('준비됨 · 운영 비활성'); + await expect(table).toContainText('훼 · default'); + await expect(table).not.toContainText('hwe:default'); await expect(page.getByRole('button', { name: '이 기기 알림 켜기' })).toBeDisabled(); const checkboxes = table.getByRole('checkbox'); await expect(checkboxes).toHaveCount(9); diff --git a/app/gateway-frontend/src/components/ServerProfileTabs.vue b/app/gateway-frontend/src/components/ServerProfileTabs.vue index 8f9d9bd5..174d408a 100644 --- a/app/gateway-frontend/src/components/ServerProfileTabs.vue +++ b/app/gateway-frontend/src/components/ServerProfileTabs.vue @@ -5,6 +5,7 @@ type ServerProfileTab = 'status' | 'version' | 'scenario' | 'cancel'; const props = defineProps<{ profileName: string; + profileLabel: string; activeTab: ServerProfileTab; canDeploy: boolean; canReset: boolean; @@ -45,7 +46,7 @@ const tabs = computed(() =>