/** * Stage 4 E2E (docs/10 4๋‹จ๊ณ„): three guests in real browsers. * Room from the home page, join from the open-room list, host settings reach everyone at once with the song count, * ready reset, waiting-room chat, password room (๐Ÿ”’ in the list), kick, server restart notice, phone and dark screens. * Run: bun run build && bun e2e/rooms.e2e.ts (needs /usr/bin/google-chrome) */ import { chromium, type Browser, type Page } from 'playwright-core'; import { mkdirSync, mkdtempSync } from 'node:fs'; import { join } from 'node:path'; import { loadConfig } from '../apps/server/src/config'; import { startServer } from '../apps/server/src/server'; import { Catalog } from '../apps/server/src/collector/catalog'; const PORT = Number(process.env.E2E_PORT ?? 4619); const ORIGIN = `http://localhost:${PORT}`; const SHOTS = process.env.E2E_SHOTS ?? join(import.meta.dir, '../test-results'); mkdirSync(SHOTS, { recursive: true }); const config = loadConfig({ PORT: String(PORT), DB_PATH: join(mkdtempSync(join(process.env.TMPDIR ?? '/tmp', 'mq-e2e-')), 'app.db'), PUBLIC_ORIGIN: ORIGIN, SUPERADMIN_DISCORD_IDS: '900000000000000001', }); const boot = () => startServer({ config, log: () => {}, staticDir: join(import.meta.dir, '../apps/web/dist'), stopWaitMs: 200 }); let app = boot(); // Catalog: ๊ตญ๋‚ด ๋ฐœ๋ผ๋“œ 3๋‹จ๊ณ„ 4๊ณก(1๊ณก์€ ์›๊ณก ํ™•์ธ ์ค‘), ๋Œ„์Šค 3๋‹จ๊ณ„ 2๊ณก, ๋ฐœ๋ผ๋“œ 5๋‹จ๊ณ„ 1๊ณก. { const c = new Catalog(app.db); const add = (title: string, genres: string[], year: number, level: number, matched = true) => { const [id] = c.upsert({ title, artists: [{ name: `๊ฐ€์ˆ˜${title}` }], year, genres, source: 'e2e', ref: title }); c.autoLevel(id!, 'all', level); if (matched) app.db.query("UPDATE songs SET youtube_status = 'matched', embeddable = 1, youtube_id = 'VO88htcm09E' WHERE id = ?").run(id!); }; add('๋ฐœ๋ผ๋“œ1', ['kpop', 'ballad'], 2005, 3); add('๋ฐœ๋ผ๋“œ2', ['kpop', 'ballad'], 2007, 3); add('๋ฐœ๋ผ๋“œ3', ['kpop', 'ballad'], 2012, 3); add('๋ฐœ๋ผ๋“œํ™•์ธ์ค‘', ['kpop', 'ballad'], 2010, 3, false); add('๋Œ„์Šค1', ['kpop', 'dance'], 2009, 3); add('๋Œ„์Šค2', ['kpop', 'dance'], 2015, 3); add('์–ด๋ ค์šด๋ฐœ๋ผ๋“œ', ['kpop', 'ballad'], 2001, 5); } const browser: Browser = await chromium.launch({ executablePath: process.env.CHROME ?? '/usr/bin/google-chrome', headless: true }); const errors: string[] = []; const step = async (name: string, fn: () => Promise) => { const t0 = performance.now(); try { await fn(); console.log(`โœ“ ${name} (${Math.round(performance.now() - t0)}ms)`); } catch (e) { console.log(`โœ— ${name}: ${(e as Error).message.split('\n')[0]}`); throw e; } }; const expect = (ok: unknown, msg: string) => { if (!ok) throw new Error(msg); }; async function guestPage(name: string, opts: { width?: number; height?: number; dark?: boolean; mobile?: boolean } = {}): Promise { const ctx = await browser.newContext({ viewport: { width: opts.width ?? 1440, height: opts.height ?? 900 }, locale: 'ko-KR', colorScheme: opts.dark ? 'dark' : 'light', isMobile: opts.mobile, hasTouch: opts.mobile, }); const p = await ctx.newPage(); p.on('pageerror', (e) => errors.push(`${name}: ${e.message}`)); await p.goto(ORIGIN + '/'); await p.getByLabel('๊ฒŒ์ŠคํŠธ ๋‹‰๋„ค์ž„ (2~12์ž)').fill(name); await p.getByRole('button', { name: '๊ฒŒ์ŠคํŠธ๋กœ ์‹œ์ž‘' }).click(); await p.getByRole('button', { name: `๋‚ด ๊ณ„์ •: ${name}` }).waitFor(); return p; } const waitPool = (p: Page, n: number) => p.locator('.pool-banner h2', { hasText: `์กฐ๊ฑด์— ๋งž๋Š” ๊ณก ${n}๊ณก` }).waitFor({ timeout: 5000 }); let failed = false; let code = ''; try { const a = await guestPage('๋ฐฉ์žฅ๋‹˜'); const b = await guestPage('์ฒ ์ˆ˜'); await step('๊ฒŒ์ŠคํŠธ๊ฐ€ ์ฒซ ํ™”๋ฉด์—์„œ ๋ฐฉ ๋งŒ๋“ค๊ธฐ โ†’ ๋Œ€๊ธฐ์‹ค, ๊ธฐ๋ณธ ์„ค์ •(๊ณต๊ฐœยทโ˜…3ยท30๋ฌธ์ œ), ์กฐ๊ฑด์— ๋งž๋Š” ๊ณก๊ณผ ์›๊ณก ํ™•์ธ ์ค‘ ๊ณก ์ˆ˜', async () => { await a.getByRole('button', { name: '๏ผ‹ ๋ฐฉ ๋งŒ๋“ค๊ธฐ' }).click(); await a.waitForURL(/\/r\/\d{6}$/); code = a.url().slice(-6); await a.getByRole('heading', { name: '๋ฐฉ์žฅ๋‹˜๋‹˜์˜ ๋ฐฉ' }).waitFor(); await a.getByRole('heading', { name: '๋ฐฉ ์„ค์ •' }).waitFor(); await a.getByText('๋ฐ”๊พธ๋ฉด ๋ฐ”๋กœ ๋ชจ๋‘์—๊ฒŒ ๋ณด์—ฌ์š”').waitFor(); // ๊ธฐ๋ณธ โ˜…3 ์ „์ฒด ์žฅ๋ฅด: ๋ฐœ๋ผ๋“œ1~3 + ๋Œ„์Šค1~2 = 5๊ณก, ์›๊ณก ํ™•์ธ ์ค‘ 1๊ณก await waitPool(a, 5); await a.getByText('์›๊ณก ํ™•์ธ ์ค‘์ธ ๊ณก 1๊ณก์€ ํ™•์ธ์ด ๋๋‚˜๋ฉด ๋‚˜์™€์š”').waitFor(); expect((await a.getByRole('radiogroup', { name: '๋ฐฉ ๊ณต๊ฐœ' }).getByRole('radio', { checked: true }).innerText()) === '๊ณต๊ฐœ', '๊ธฐ๋ณธ ๊ณต๊ฐœ๊ฐ€ ์•„๋‹˜'); expect(await a.getByRole('radio', { name: /^3๋‹จ๊ณ„/ }).getAttribute('aria-checked') === 'true', '๊ธฐ๋ณธ 3๋‹จ๊ณ„ ์•„๋‹˜'); }); await step('๋‹ค๋ฅธ ๊ฒŒ์ŠคํŠธ: ์—ด๋ฆฐ ๋ฐฉ ๋ชฉ๋ก(์ „์ฒด/๋Œ€๊ธฐ ์ค‘)์—์„œ ๋ณด๊ณ  ๋“ค์–ด๊ฐ€๊ธฐ, ์„œ๋กœ ๋ณด์ž„, ์„ค์ •์€ ์ฝ๊ธฐ ์ „์šฉ', async () => { await b.goto(ORIGIN + '/'); const card = b.locator('.room-card', { hasText: '๋ฐฉ์žฅ๋‹˜๋‹˜์˜ ๋ฐฉ' }); await card.waitFor({ timeout: 8000 }); await b.getByRole('button', { name: '์ง„ํ–‰ ์ค‘ (์ค‘๊ฐ„ ์ฐธ์—ฌ ๊ฐ€๋Šฅ)' }).click(); await card.waitFor({ state: 'detached' }); await b.getByRole('button', { name: '๋Œ€๊ธฐ ์ค‘' }).click(); await card.getByRole('button', { name: '๋“ค์–ด๊ฐ€๊ธฐ' }).click(); await b.waitForURL(`**/r/${code}`); await b.getByText('๋ฐฉ์žฅ๋งŒ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์–ด์š”').waitFor(); await a.locator('.pl', { hasText: '์ฒ ์ˆ˜' }).waitFor(); await b.locator('.pl.host', { hasText: '๋ฐฉ์žฅ๋‹˜' }).waitFor(); expect(await b.getByRole('radio', { name: /^5๋‹จ๊ณ„/ }).isDisabled(), '์†๋‹˜์ด ๋‚œ์ด๋„๋ฅผ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Œ'); }); await step('๋ฐฉ์žฅ์ด ์žฅ๋ฅดยท๋‚œ์ด๋„๋ฅผ ๋ฐ”๊พธ๋ฉด ์†๋‹˜ ํ™”๋ฉด์— ๋ฐ”๋กœ ๋ฐ˜์˜, ๊ณก ์ˆ˜๋„ ๋‹ค์‹œ ์…ˆ(๊ฐ™์€ ๋ฌถ์Œ ๋˜๋Š”ยท๋‹ค๋ฅธ ๋ฌถ์Œ ๊ทธ๋ฆฌ๊ณ )', async () => { const t0 = performance.now(); await a.locator('.chip', { hasText: '๋ฐœ๋ผ๋“œ' }).click(); await waitPool(b, 3); // โ˜…3 ๋ฐœ๋ผ๋“œ: ๋ฐœ๋ผ๋“œ1~3 const ms = Math.round(performance.now() - t0); expect(await b.locator('.chip[aria-pressed="true"]', { hasText: '๋ฐœ๋ผ๋“œ' }).isVisible(), '์†๋‹˜ ํ™”๋ฉด์— ๋ฐœ๋ผ๋“œ ์„ ํƒ ์•ˆ ๋ณด์ž„'); await a.locator('.chip', { hasText: '๋Œ„์Šค' }).click(); await waitPool(b, 5); // ๋ฐœ๋ผ๋“œ ๋˜๋Š” ๋Œ„์Šค await a.getByRole('radio', { name: /^5๋‹จ๊ณ„/ }).click(); await waitPool(b, 1); // โ˜…5: ์–ด๋ ค์šด๋ฐœ๋ผ๋“œ await b.getByText('5๋‹จ๊ณ„ ยท ์žฅ๋ฅด ํŒฌ ํ•„์ˆ˜๊ณก').waitFor(); await a.getByRole('radio', { name: /^3๋‹จ๊ณ„/ }).click(); await waitPool(b, 5); console.log(` ์„ค์ • ๋ฐ˜์˜ โ†’ ์†๋‹˜ ํ™”๋ฉด ${ms}ms`); }); await step('์†๋‹˜ ์ค€๋น„ โ†’ ๋ฐฉ์žฅ ํ™”๋ฉด์— ์ค€๋น„, ๋ฐฉ์žฅ์ด ์„ค์ •์„ ๋ฐ”๊พธ๋ฉด ์ค€๋น„๊ฐ€ ํ’€๋ฆผ', async () => { await b.getByRole('button', { name: '์ค€๋น„', exact: true }).click(); await a.locator('.pl', { hasText: '์ฒ ์ˆ˜' }).getByText('์ค€๋น„', { exact: true }).waitFor(); await b.getByRole('button', { name: '์ค€๋น„ ์™„๋ฃŒ โœ“' }).waitFor(); await a.getByRole('radiogroup', { name: '๋ฌธ์ œ ์ˆ˜' }).getByRole('radio', { name: '50' }).click(); await b.getByRole('button', { name: '์ค€๋น„', exact: true }).waitFor(); await a.locator('.pl', { hasText: '์ฒ ์ˆ˜' }).getByText('๋Œ€๊ธฐ', { exact: true }).waitFor(); await b.getByText('๋ฌธ์ œ ์ˆ˜๋ณด๋‹ค ๊ณก์ด ์ ์–ด์„œ 5๋ฌธ์ œ๋งŒ ๋‚˜์™€์š”.').waitFor(); }); await step('๋Œ€๊ธฐ์‹ค ์ฑ„ํŒ…: ์ž…์žฅ ์•ˆ๋‚ด, ์„œ๋กœ ๋ณด๋‚ธ ๋ง์ด ๋ฐ”๋กœ ๋ณด์ž„, ๋‚ด ์ค„ ํ‘œ์‹œ', async () => { await a.getByText('โ€” ์ฒ ์ˆ˜๋‹˜์ด ๋“ค์–ด์™”์–ด์š” โ€”').waitFor(); await b.getByLabel('์ฑ„ํŒ… ์ž…๋ ฅ').fill('์•ˆ๋…•ํ•˜์„ธ์š” 2000๋…„๋Œ€ ๋ฐœ๋ผ๋“œ ใ„ฑใ„ฑ'); await b.getByLabel('์ฑ„ํŒ… ์ž…๋ ฅ').press('Enter'); await a.locator('.chat-line', { hasText: '์•ˆ๋…•ํ•˜์„ธ์š” 2000๋…„๋Œ€ ๋ฐœ๋ผ๋“œ ใ„ฑใ„ฑ' }).waitFor(); await b.locator('.chat-line.me:not(.pending)', { hasText: '์•ˆ๋…•ํ•˜์„ธ์š” 2000๋…„๋Œ€ ๋ฐœ๋ผ๋“œ ใ„ฑใ„ฑ' }).waitFor(); await a.getByLabel('์ฑ„ํŒ… ์ž…๋ ฅ').fill('์ข‹์•„์š”'); await a.getByRole('button', { name: '๋ณด๋‚ด๊ธฐ' }).click(); await b.locator('.chat-line', { hasText: '์ข‹์•„์š”' }).waitFor(); expect((await a.getByLabel('์ฑ„ํŒ… ์ž…๋ ฅ').inputValue()) === '', '๋ณด๋‚ธ ๋’ค ์ž…๋ ฅ์ฐฝ์ด ๋น„์ง€ ์•Š์Œ'); }); await step('๋„๋ฐฐ ๋ฐฉ์ง€๋ฅผ ์ผœ๋ฉด ๊ฑฐ์ ˆ๋œ ๋ง์€ "๋ณด๋‚ด๋Š” ์ค‘"์œผ๋กœ ๋‚จ์ง€ ์•Š๊ณ  ์•ˆ๋‚ด๋งŒ ๋œธ', async () => { const site = app.settings.getSite(); app.settings.setSite({ ...site, chatFloodGuard: true, chatRatePerSec: 1, chatBurst: 2 }, 'e2e'); const box = b.getByLabel('์ฑ„ํŒ… ์ž…๋ ฅ'); for (let i = 0; i < 5; i++) { await box.fill(`๋น ๋ฅธ๋ง${i}`); await box.press('Enter'); } await b.getByText('์ฑ„ํŒ…์„ ๋„ˆ๋ฌด ๋นจ๋ฆฌ ๋ณด๋‚ด๊ณ  ์žˆ์–ด์š”. ์ž ๊น ์‰ฌ์—ˆ๋‹ค ๋ณด๋‚ด ์ฃผ์„ธ์š”.').first().waitFor(); await a.locator('.chat-line', { hasText: '๋น ๋ฅธ๋ง1' }).waitFor(); await b.waitForFunction(() => document.querySelectorAll('.chat-line.pending').length === 0, null, { timeout: 3000 }); const shown = await a.locator('.chat-line', { hasText: '๋น ๋ฅธ๋ง' }).count(); expect(shown === 2, `๋ฐ›์€ ์ชฝ์— ${shown}์ค„`); expect((await b.locator('.chat-line', { hasText: '๋น ๋ฅธ๋ง' }).count()) === 2, '๊ฑฐ์ ˆ๋œ ๋ง์ด ๋ณด๋‚ธ ์ชฝ ํ™”๋ฉด์— ๋‚จ์Œ'); app.settings.setSite({ ...site, chatFloodGuard: false }, 'e2e'); }); await step('๋น„๋ฐ€๋ฒˆํ˜ธ ๋ฐฉ: ๋ชฉ๋ก์— ๐Ÿ”’, ๋“ค์–ด๊ฐˆ ๋•Œ ๋น„๋ฐ€๋ฒˆํ˜ธ(ํ‹€๋ฆฌ๋ฉด ์•ˆ๋‚ด), ๋งž์œผ๋ฉด ์ž…์žฅํ•˜๊ณ  ์ง€๋‚œ ์ฑ„ํŒ…์ด ๋ณด์ž„', async () => { await a.getByRole('radiogroup', { name: '๋ฐฉ ๊ณต๊ฐœ' }).getByRole('radio', { name: '๋น„๋ฐ€๋ฒˆํ˜ธ' }).click(); await a.getByText('๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ •ํ•ด์•ผ ์ž ๊ฒจ์š”').waitFor(); await a.getByLabel('๋ฐฉ ๋น„๋ฐ€๋ฒˆํ˜ธ').fill('4321'); await a.getByRole('button', { name: '์ •ํ•˜๊ธฐ' }).click(); await a.getByText('๋น„๋ฐ€๋ฒˆํ˜ธ ์žˆ์Œ').waitFor(); const c = await guestPage('์˜ํฌ'); const card = c.locator('.room-card', { hasText: '๋ฐฉ์žฅ๋‹˜๋‹˜์˜ ๋ฐฉ' }); await card.getByText('๐Ÿ”’ ๋น„๋ฐ€๋ฒˆํ˜ธ').waitFor({ timeout: 8000 }); await card.getByRole('button', { name: '๋“ค์–ด๊ฐ€๊ธฐ' }).click(); await c.getByRole('heading', { name: '๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ ํ•„์š”ํ•œ ๋ฐฉ์ด์—์š”' }).waitFor(); await c.getByLabel('๋ฐฉ ๋น„๋ฐ€๋ฒˆํ˜ธ').fill('0000'); await c.getByRole('button', { name: '๋“ค์–ด๊ฐ€๊ธฐ' }).click(); await c.getByText('๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ ํ‹€๋ ธ์–ด์š”.').waitFor(); await c.getByLabel('๋ฐฉ ๋น„๋ฐ€๋ฒˆํ˜ธ').fill('4321'); await c.getByRole('button', { name: '๋“ค์–ด๊ฐ€๊ธฐ' }).click(); await c.getByRole('heading', { name: '๋ฐฉ์žฅ๋‹˜๋‹˜์˜ ๋ฐฉ' }).waitFor(); await c.locator('.chat-line', { hasText: '์•ˆ๋…•ํ•˜์„ธ์š” 2000๋…„๋Œ€ ๋ฐœ๋ผ๋“œ ใ„ฑใ„ฑ' }).waitFor(); await a.screenshot({ path: join(SHOTS, 'stage4-room-host.png'), fullPage: true }); await c.screenshot({ path: join(SHOTS, 'stage4-room-guest.png'), fullPage: true }); await step('๋ฐฉ์žฅ์ด ๋‚ด๋ณด๋‚ด๊ธฐ โ†’ ์ฒซ ํ™”๋ฉด์œผ๋กœ ๋Œ์•„๊ฐ€๋ฉฐ ์•ˆ๋‚ด', async () => { const row = a.locator('.pl', { hasText: '์˜ํฌ' }); await row.hover(); await row.getByRole('button', { name: '์˜ํฌ ๋‚ด๋ณด๋‚ด๊ธฐ' }).click(); await c.waitForURL(`${ORIGIN}/`); await c.getByText('๋ฐฉ์žฅ์ด ๋ฐฉ์—์„œ ๋‚ด๋ณด๋ƒˆ์–ด์š”.').waitFor(); await b.getByText('โ€” ์˜ํฌ๋‹˜์ด ๋‚ด๋ณด๋‚ด์กŒ์–ด์š” โ€”').waitFor(); await c.context().close(); }); }); await step('๋ฐฉ์žฅ ๋„˜๊ธฐ๊ธฐ โ†’ ์†๋‹˜์ด ๋ฐฉ์žฅ์ด ๋˜์–ด ์„ค์ •์„ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Œ', async () => { const row = a.locator('.pl', { hasText: '์ฒ ์ˆ˜' }); await row.hover(); await row.getByRole('button', { name: '์ฒ ์ˆ˜์—๊ฒŒ ๋ฐฉ์žฅ ๋„˜๊ธฐ๊ธฐ' }).click(); await b.getByText('๋ฐ”๊พธ๋ฉด ๋ฐ”๋กœ ๋ชจ๋‘์—๊ฒŒ ๋ณด์—ฌ์š”').waitFor(); await b.getByText('โ€” ๋ฐฉ์žฅ์ด ์ฒ ์ˆ˜๋‹˜์œผ๋กœ ๋ฐ”๋€Œ์—ˆ์–ด์š” โ€”').waitFor(); await b.getByRole('radio', { name: /^4๋‹จ๊ณ„/ }).click(); await a.getByText('4๋‹จ๊ณ„ ยท ๊ฐ€๋” ๋“ค์–ด๋„ ์•„๋Š” ๊ณก').waitFor(); }); await step('ํœด๋Œ€ํฐ(390px)ยท๋‹คํฌ ํ™”๋ฉด: ๋Œ€๊ธฐ์‹ค์ด ๊ฐ€๋กœ๋กœ ๋„˜์น˜์ง€ ์•Š์Œ', async () => { const m = await guestPage('ํฐ์†๋‹˜', { width: 390, height: 844, mobile: true }); await m.goto(`${ORIGIN}/r/${code}`); await m.getByRole('heading', { name: '๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ ํ•„์š”ํ•œ ๋ฐฉ์ด์—์š”' }).waitFor(); await m.getByLabel('๋ฐฉ ๋น„๋ฐ€๋ฒˆํ˜ธ').fill('4321'); await m.getByRole('button', { name: '๋“ค์–ด๊ฐ€๊ธฐ' }).click(); await m.getByRole('heading', { name: '๋ฐฉ ์„ค์ •' }).waitFor(); const overflow = await m.evaluate(() => document.documentElement.scrollWidth - window.innerWidth); expect(overflow <= 0, `ํœด๋Œ€ํฐ ๊ฐ€๋กœ ๋„˜์นจ ${overflow}px`); await m.screenshot({ path: join(SHOTS, 'stage4-room-mobile.png'), fullPage: true }); const d = await guestPage('๋ฐค์†๋‹˜', { dark: true }); await d.goto(`${ORIGIN}/r/${code}`); await d.getByLabel('๋ฐฉ ๋น„๋ฐ€๋ฒˆํ˜ธ').fill('4321'); await d.getByRole('button', { name: '๋“ค์–ด๊ฐ€๊ธฐ' }).click(); await d.locator('.chat-line', { hasText: '์ข‹์•„์š”' }).waitFor(); await d.screenshot({ path: join(SHOTS, 'stage4-room-dark.png'), fullPage: true }); await m.context().close(); await d.context().close(); }); await step('์„œ๋ฒ„๋ฅผ ๋‹ค์‹œ ์ผœ๋ฉด(์—…๋ฐ์ดํŠธ) ๋ฐฉ์ด ์‚ฌ๋ผ์กŒ๋‹ค๊ณ  ์•ˆ๋‚ด โ€” ๋‹ค์‹œ ์—ฐ๊ฒฐํ•œ ํ™”๋ฉด๊ณผ ์ƒˆ๋กœ๊ณ ์นจํ•œ ํ™”๋ฉด ๋ชจ๋‘', async () => { await app.stop(); app = boot(); await a.getByText('์„œ๋ฒ„๊ฐ€ ์—…๋ฐ์ดํŠธ๋˜๋ฉด์„œ ๋ฐฉ์ด ๋‹ซํ˜”์–ด์š”. ๋ฐฉ์„ ์ƒˆ๋กœ ๋งŒ๋“ค์–ด ์ฃผ์„ธ์š”.').waitFor({ timeout: 15000 }); await b.reload(); await b.getByText('์„œ๋ฒ„๊ฐ€ ์—…๋ฐ์ดํŠธ๋˜๋ฉด์„œ ๋ฐฉ์ด ๋‹ซํ˜”์–ด์š”. ๋ฐฉ์„ ์ƒˆ๋กœ ๋งŒ๋“ค์–ด ์ฃผ์„ธ์š”.').waitFor({ timeout: 15000 }); // ๋‹ค๋ฅธ ์‚ฌ๋žŒ์ด ์—†๋Š” ์ฝ”๋“œ๋กœ ๋“ค์–ด์˜ค๋ฉด ์›๋ž˜ ์•ˆ๋‚ด const fresh = await browser.newContext({ locale: 'ko-KR' }); const f = await fresh.newPage(); await f.goto(ORIGIN + '/'); await f.getByLabel('๊ฒŒ์ŠคํŠธ ๋‹‰๋„ค์ž„ (2~12์ž)').fill('์ƒˆ์†๋‹˜'); await f.getByRole('button', { name: '๊ฒŒ์ŠคํŠธ๋กœ ์‹œ์ž‘' }).click(); await f.getByRole('button', { name: '๋‚ด ๊ณ„์ •: ์ƒˆ์†๋‹˜' }).waitFor(); await f.goto(`${ORIGIN}/r/${code}`); await f.getByText('๋ฐฉ์„ ์ฐพ์„ ์ˆ˜ ์—†์–ด์š”. ์ฝ”๋“œ๋ฅผ ๋‹ค์‹œ ํ™•์ธํ•ด ์ฃผ์„ธ์š”.').waitFor(); await fresh.close(); }); expect(errors.length === 0, `ํŽ˜์ด์ง€ ์˜ค๋ฅ˜: ${errors.join(' | ')}`); } catch (e) { if (!(e instanceof Error && e.message)) console.log(e); failed = true; } finally { await browser.close(); await app.stop(); } console.log(failed ? 'E2E FAILED' : 'E2E PASSED'); process.exit(failed ? 1 : 0);