모든 게임: 결과·팝업은 애니메이션이 끝난 뒤에, 증강 윷놀이: 이의있음!이 다음 판에도 뜨게, 증강 고르는 목록·나오게 할 증강을 팝업 목록으로
- lib/motion: motionBusy / useMotionHold / useMotionSettled / useAfterMotionValue / AfterMotion - 방 화면: 결과 창과 상태 줄은 판이 멈춘 뒤에(실시간 게임은 상태 줄 그대로), 새 판마다 판 화면을 새로 그림 (결과 창에 둔 채 다음 판이 시작되면 이전 판의 효과 번호가 남아 이의있음!·알림이 안 뜨던 문제) - 41개 게임: 결과 패널·배너·점수·팝업이 마지막 움직임 뒤에 나오도록 게임별로 정리 - 증강 윷놀이: 명탐정·배달·손버릇·따라쟁이·착각 대상은 아이콘과 설명이 다 보이는 목록에서, 방 설정의 나오게 할 증강은 팝업 목록에서 스위치로 켜고 끔 - e2e: 늦게 바뀌는 상태 줄·결과 창과 새 증강 화면에 맞춤 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -244,7 +244,9 @@ async function gostopStep(p: Page, state: { go: number; stop: number; picks: num
|
||||
const target = (await card.count()) ? card : any;
|
||||
if (!(await target.count())) {
|
||||
const dummy = p.getByRole('button', { name: /^빈패 내기/ });
|
||||
if (await dummy.isEnabled().catch(() => false)) {
|
||||
// The status line now changes only after the move's animation, so "내 차례예요" can still show for a moment after
|
||||
// my play while the hand is already disabled: don't wait 30 s for a 빈패 button that isn't there.
|
||||
if ((await dummy.count()) && (await dummy.isEnabled().catch(() => false))) {
|
||||
await dummy.click({ timeout: 1500 });
|
||||
state.plays++;
|
||||
return 'dummy';
|
||||
@@ -1409,7 +1411,8 @@ const PLANS: Record<string, Plan> = {
|
||||
await host.getByRole('tab', { name: '단서' }).waitFor();
|
||||
const captain = async () => {
|
||||
for (let t = 0; t < 100; t++) {
|
||||
for (const p of pages) if ((await status(p)).includes('내가 반장이에요')) return p;
|
||||
// (the status line changes only after the board stops moving, so also look for the captain's buttons)
|
||||
for (const p of pages) if ((await status(p)).includes('내가 반장이에요') && (await p.getByRole('button', { name: '고르기' }).count())) return p;
|
||||
await host.waitForTimeout(100);
|
||||
}
|
||||
throw new Error('nobody is captain');
|
||||
@@ -1606,12 +1609,17 @@ const PLANS: Record<string, Plan> = {
|
||||
lobby: async (host) => {
|
||||
await host.getByRole('button', { name: '증강 윷놀이', exact: true }).first().click();
|
||||
await host.getByRole('tab', { name: '증강 윷놀이' }).click();
|
||||
await host.getByText(/켜진 증강/).first().waitFor();
|
||||
await host.getByText(/켜짐 71\/101/).first().waitFor();
|
||||
await host.screenshot({ path: join(SHOTS, 'yut-aug-options-pc.png'), fullPage: true });
|
||||
// this site's augments start off; switch them on so the game shows them too
|
||||
await host.getByText(/켜진 증강 71\/101/).first().waitFor();
|
||||
await host.getByRole('button', { name: '추가 증강 켜기' }).click();
|
||||
await host.getByText(/켜진 증강 101\/101/).first().waitFor();
|
||||
// the augment list is a popup with a switch per augment; this site's augments start off, so switch them on
|
||||
await host.getByRole('button', { name: /증강 목록 열기/ }).click();
|
||||
const list = host.getByRole('dialog', { name: '나오게 할 증강 고르기' });
|
||||
await list.getByRole('switch').first().waitFor();
|
||||
await host.screenshot({ path: join(SHOTS, 'yut-aug-list-pc.png') });
|
||||
await list.getByRole('button', { name: '추가 증강 켜기' }).click();
|
||||
await list.getByText(/켜짐 101\/101/).first().waitFor();
|
||||
await list.getByRole('button', { name: /^다 골랐어요/ }).click();
|
||||
await host.getByText(/켜짐 101\/101/).first().waitFor();
|
||||
await host.getByRole('tab', { name: '윷놀이 설정' }).click();
|
||||
await host.getByRole('button', { name: '3개', exact: true }).click();
|
||||
// 증강을 자주 고르도록 1·3·5·7·9라운드, 후보 4개
|
||||
@@ -1624,8 +1632,17 @@ const PLANS: Record<string, Plan> = {
|
||||
await guest.getByRole('button', { name: '설정 보기' }).click();
|
||||
const sheet = guest.getByRole('dialog', { name: '게임 설정' });
|
||||
await sheet.getByRole('tab', { name: '증강 윷놀이' }).click();
|
||||
await sheet.getByText(/켜진 증강/).first().waitFor();
|
||||
await sheet.getByText(/켜짐 101\/101/).first().waitFor();
|
||||
await guest.screenshot({ path: join(SHOTS, 'yut-aug-options-phone.png') });
|
||||
// not the host: the list opens read-only, and Esc closes only the list
|
||||
await sheet.getByRole('button', { name: /증강 목록 열기/ }).click();
|
||||
const view = guest.getByRole('dialog', { name: '나오게 할 증강 (보기)' });
|
||||
await view.getByRole('switch').first().waitFor();
|
||||
if (await view.getByRole('switch').first().isEnabled()) throw new Error('guest can switch augments');
|
||||
await guest.screenshot({ path: join(SHOTS, 'yut-aug-list-phone.png') });
|
||||
await guest.keyboard.press('Escape');
|
||||
await view.waitFor({ state: 'detached' });
|
||||
await sheet.waitFor();
|
||||
await guest.setViewportSize({ width: 320, height: 640 });
|
||||
await guest.emulateMedia({ colorScheme: 'dark' });
|
||||
await guest.screenshot({ path: join(SHOTS, 'yut-aug-options-phone-320-dark.png') });
|
||||
@@ -1666,12 +1683,27 @@ const PLANS: Record<string, Plan> = {
|
||||
if (await cards.count()) {
|
||||
await shotOnce(p, 'select');
|
||||
await cards.nth(stats.picks % (await cards.count())).click();
|
||||
const sel = dialog.locator('select');
|
||||
if (await sel.count()) await sel.selectOption({ index: 1 });
|
||||
// 명탐정·배달: the target is picked from a list with icons and descriptions
|
||||
const target = dialog.locator('.aug-list .aug-row');
|
||||
if (await target.count()) await target.first().click();
|
||||
await dialog.getByRole('button', { name: /고르기$/ }).click();
|
||||
stats.picks++;
|
||||
return true;
|
||||
}
|
||||
// 손버릇·따라쟁이·착각: a popup list of augments with icons and descriptions
|
||||
const rows = dialog.locator('.aug-list .aug-row');
|
||||
if (await rows.count()) {
|
||||
await shotOnce(p, 'target');
|
||||
await rows.first().click();
|
||||
await dialog.getByRole('button', { name: /(빼앗기|따라 하기|고양이로 바꾸기)$/ }).click();
|
||||
stats.prompts++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
const reopen = p.getByRole('button', { name: '고를 증강 보기' });
|
||||
if ((await reopen.count()) && !(await dialog.count())) {
|
||||
await reopen.click();
|
||||
return true;
|
||||
}
|
||||
const open = p.getByRole('button', { name: '증강 후보 보기' });
|
||||
if ((await open.count()) && !(await dialog.count())) {
|
||||
@@ -1748,7 +1780,9 @@ const PLANS: Record<string, Plan> = {
|
||||
await host.locator('.yut-board').screenshot({ path: join(SHOTS, 'yut-aug-objs-board.png') });
|
||||
}
|
||||
// 증강 칩 설명은 브라우저 title 대신 팝업 카드: PC는 마우스를 올리면, 휴대폰은 칩을 누르면 뜬다(남의 증강도)
|
||||
if (!seen.has('chip-pop') && !(await host.getByRole('dialog').count()) && (await host.locator('.aug-chip').count()) >= 2) {
|
||||
// (not while a selection / question is up: its popup now opens a moment later, once the board is still)
|
||||
const popupDue = async (p: Page) => (await p.getByRole('dialog').count()) + (await p.getByRole('button', { name: /^(증강 후보 보기|고를 증강 보기)$/ }).count()) > 0;
|
||||
if (!seen.has('chip-pop') && !(await popupDue(host)) && !(await popupDue(guest)) && (await host.locator('.aug-chip').count()) >= 2) {
|
||||
seen.add('chip-pop');
|
||||
const pop = (p: Page) => p.locator('.aug-pop[role="tooltip"]');
|
||||
for (const p of [host, guest]) {
|
||||
@@ -2872,12 +2906,15 @@ const PLANS: Record<string, Plan> = {
|
||||
let jumps = 0;
|
||||
let steps = 0;
|
||||
let shot = false;
|
||||
const over = () => host.getByRole('dialog', { name: '게임 결과' }).count();
|
||||
// The result window waits for the last move's animation: also stop as soon as the status says who won.
|
||||
const over = async () => (await host.getByRole('dialog', { name: '게임 결과' }).count()) || /승리/.test(await host.locator('.turn-status').innerText());
|
||||
const first = new Set<Page>();
|
||||
for (let turn = 0; turn < 40 && !(await over()); turn++) {
|
||||
const mover = turn % 2 === 0 ? north : south;
|
||||
const useKeys = mover === host && !first.has(mover);
|
||||
first.add(mover);
|
||||
await mover.waitForFunction(() => /내 차례예요|승리/.test(document.querySelector('.turn-status')?.textContent ?? ''), null, { timeout: 15_000 });
|
||||
if (await over()) break;
|
||||
if (await qdStep(mover, useKeys)) jumps++;
|
||||
steps++;
|
||||
if (steps === 6 && !shot) {
|
||||
|
||||
Reference in New Issue
Block a user