게임 결과 화면: 등수 옆에 그 판의 최종 점수 표시

- GameResult/GameResultView에 scoreText(게임별 표시 문구) 추가
- 점수가 있는 18개 게임이 결과에 최종 점수 문구를 넣음 (n점, n칩, 총자산 nP, 난 말 n개, 카드 n장 등)
- 점수가 없는 게임(오목·체스·쿼리도·다빈치 코드·99·뱅·마피아·바퀴벌레 포커)은 등수만
- 결과 창 각 줄 오른쪽에 최종 점수(진하게), 그 아래 이 방 전적
- 전 게임 무작위 진행 테스트, 요트 기권 E2E, docs/06·09 갱신

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-11 02:07:02 +09:00
parent 27ed513011
commit 009214c9f3
29 changed files with 153 additions and 16 deletions

View File

@@ -70,7 +70,7 @@ try {
const pc = await browser.newContext({ viewport: { width: 1440, height: 900 }, locale: 'ko-KR' });
const phone = await browser.newContext({ viewport: { width: 390, height: 844 }, deviceScaleFactor: 2, isMobile: true, hasTouch: true, locale: 'ko-KR' });
// The first-game "30초 규칙 요약" cards are tested in e2e/tutorial.e2e.ts; mark them seen here.
for (const ctx of [pc, phone]) await ctx.addInitScript(() => { for (const g of ['omok', 'one-card']) localStorage.setItem(`bg:qs:${g}`, '1'); });
for (const ctx of [pc, phone]) await ctx.addInitScript(() => { for (const g of ['omok', 'one-card', 'yacht']) localStorage.setItem(`bg:qs:${g}`, '1'); });
const a = await pc.newPage();
const b = await phone.newPage();
const errors: string[] = [];
@@ -244,6 +244,28 @@ try {
if (app.rooms.get(code)) throw new Error('room still open after leaving the lobby');
});
await step('요트(연습): 기권 → 결과 창에 등수와 최종 점수', async () => {
await b.goto(`${ORIGIN}/g/yacht`);
await b.getByRole('button', { name: '🤖 컴퓨터와 연습하기' }).click();
await b.waitForURL(/\/r\/\d{6}$/);
await b.getByLabel('자리').getByText('컴퓨터 1').waitFor();
await b.getByRole('button', { name: '▶ 게임 시작' }).click();
await b.getByRole('button', { name: '🏳 기권' }).click();
await b.getByRole('button', { name: '기권하기' }).click();
const result = b.getByRole('dialog', { name: '게임 결과' });
await result.waitFor();
const ranks = await result.locator('strong', { hasText: /^\d+등$/ }).allInnerTexts();
const scores = await result.locator('.result-score').allInnerTexts();
if (ranks.length !== 2 || scores.length !== 2 || !scores.every((t) => /^\d+점$/.test(t))) {
throw new Error(`ranks ${JSON.stringify(ranks)} scores ${JSON.stringify(scores)}`);
}
await Bun.sleep(400); // let the sheet finish sliding in
await b.screenshot({ path: join(SHOTS, 'bots-5-yacht-result-phone.png') });
console.log(` yacht result: ${ranks.map((r, i) => `${r} ${scores[i]}`).join(', ')}`);
await result.getByRole('button', { name: '방 나가기' }).click();
await b.waitForURL(`${ORIGIN}/`);
});
await step('게스트 로그아웃 → 계정 삭제', async () => {
const id = userId('호랑이')!;
await a.getByRole('button', { name: '내 계정: 호랑이' }).click();