채팅 연타가 몇 초씩 밀리던 문제: 브라우저가 0.55초(마피아·라이어 0.75초)에 한 줄씩만 내보내던 대기열과 게임 채팅 0.7초 간격 제한을 없애고, 방 채팅·마피아·라이어가 같은 속도 규칙(한 번에 6줄, 그 뒤 0.3초에 한 줄)을 쓰게. 사람이 치는 속도로는 기다리지 않고 바로 올라감
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@ const step = async (name: string, fn: () => Promise<void>) => {
|
||||
}
|
||||
};
|
||||
|
||||
/** Send one chat line through the input (the server allows one line per 0.5 s per person). */
|
||||
/** Send one chat line through the input. */
|
||||
async function say(p: Page, text: string) {
|
||||
const input = p.locator('.chat-panel input[aria-label="메시지"]').first();
|
||||
await input.fill(text);
|
||||
@@ -163,14 +163,19 @@ try {
|
||||
await b.getByRole('button', { name: '채팅', exact: true }).waitFor();
|
||||
});
|
||||
|
||||
await step('빠르게 여러 번 Enter: 전부 순서대로 들어감', async () => {
|
||||
await step('빠르게 여러 번 Enter: 전부 순서대로, 바로 들어감', async () => {
|
||||
await a.waitForTimeout(1500);
|
||||
const input = a.locator('.chat-panel input[aria-label="메시지"]').first();
|
||||
const t0 = performance.now();
|
||||
for (let i = 1; i <= 7; i++) {
|
||||
await input.fill(`연타 ${i}`);
|
||||
await input.press('Enter');
|
||||
}
|
||||
for (let i = 1; i <= 7; i++) await a.locator('.chat-line', { hasText: `연타 ${i}` }).waitFor({ timeout: 10_000 });
|
||||
// Lines used to go out one per 0.55 s (7 lines ≈ 3.3 s); now a quick run goes at once.
|
||||
const ms = performance.now() - t0;
|
||||
if (ms > 1500) throw new Error(`7 quick lines took ${Math.round(ms)}ms to show`);
|
||||
console.log(` 7 quick lines shown in ${Math.round(ms)}ms`);
|
||||
const got = await a.locator('.chat-line .chat-text', { hasText: /^연타 \d$/ }).allInnerTexts();
|
||||
if (got.join(',') !== [1, 2, 3, 4, 5, 6, 7].map((i) => `연타 ${i}`).join(',')) throw new Error(`order/lost: ${got.join(',')}`);
|
||||
// The other side got them all too (phone sheet closed: the badge counts 7).
|
||||
|
||||
Reference in New Issue
Block a user