증강 윷놀이: 증강 칩·증강 쓰기 버튼의 설명을 브라우저 title 대신 팝업 카드로(마우스 올리기·키보드 포커스, 휴대폰은 눌러서)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1747,6 +1747,37 @@ const PLANS: Record<string, Plan> = {
|
||||
seen.add('objs');
|
||||
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) {
|
||||
seen.add('chip-pop');
|
||||
const pop = (p: Page) => p.locator('.aug-pop[role="tooltip"]');
|
||||
for (const p of [host, guest]) {
|
||||
const chips = p.locator('.aug-chip');
|
||||
if ((await chips.count()) < 2) throw new Error('augment chips missing');
|
||||
for (const i of [0, 1]) {
|
||||
const chip = chips.nth(i);
|
||||
if (await chip.getAttribute('title')) throw new Error('augment chip still uses a title tooltip');
|
||||
if (p === host) await chip.hover();
|
||||
else await chip.tap();
|
||||
await pop(p).waitFor({ timeout: 3000 });
|
||||
const name = await pop(p).getByRole('heading').innerText();
|
||||
if (!(await chip.getAttribute('aria-label'))?.startsWith(name)) throw new Error(`popup shows ${name}, not the chip's augment`);
|
||||
if ((await pop(p).count()) !== 1) throw new Error('more than one augment popup');
|
||||
if ((await chip.getAttribute('aria-describedby')) !== (await pop(p).getAttribute('id'))) throw new Error('popup not linked to chip');
|
||||
const box = (await pop(p).boundingBox())!;
|
||||
const vp = p.viewportSize()!;
|
||||
if (box.x < 0 || box.y < 0 || box.x + box.width > vp.width || box.y + box.height > vp.height) throw new Error(`augment popup off screen ${JSON.stringify(box)}`);
|
||||
if (i === 0) {
|
||||
await p.waitForTimeout(250);
|
||||
await p.screenshot({ path: join(SHOTS, `yut-aug-chip-pop-${tag(p)}.png`) });
|
||||
}
|
||||
}
|
||||
if (p === host) await p.mouse.move(2, 2);
|
||||
else await p.locator('.aug-bar').first().tap();
|
||||
await pop(p).waitFor({ state: 'detached', timeout: 3000 });
|
||||
}
|
||||
console.log(' yut-aug: chip popups ok (hover on PC, tap on phone)');
|
||||
}
|
||||
if (steps === 30 || steps === 120 || steps === 200) {
|
||||
await host.screenshot({ path: join(SHOTS, `yut-aug-mid${steps}-pc.png`) });
|
||||
await guest.screenshot({ path: join(SHOTS, `yut-aug-mid${steps}-phone.png`), fullPage: true });
|
||||
|
||||
Reference in New Issue
Block a user