fix(web-test): clickElement — pause before auto-clicking confirmation during recording

When video recording is active, wait 1.5s before clicking confirmation
dialog buttons so viewers can see the dialog in the video.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-03-27 11:42:38 +03:00
parent bc4ee63986
commit cce00a4def
@@ -1939,6 +1939,7 @@ export async function clickElement(text, { dblclick, table, toggle, expand, time
return { error: 'not_found', available: btns.map(el => norm(el.innerText)).filter(Boolean) }; return { error: 'not_found', available: btns.map(el => norm(el.innerText)).filter(Boolean) };
})()`); })()`);
if (btnResult?.error) throw new Error(`clickElement: "${text}" not found among confirmation buttons. Available: ${btnResult.available?.join(', ') || 'none'}`); if (btnResult?.error) throw new Error(`clickElement: "${text}" not found among confirmation buttons. Available: ${btnResult.available?.join(', ') || 'none'}`);
if (recorder) await page.waitForTimeout(1500); // show confirmation dialog to viewer during recording
await page.mouse.click(btnResult.x, btnResult.y); await page.mouse.click(btnResult.x, btnResult.y);
await waitForStable(); await waitForStable();
const state = await getFormState(); const state = await getFormState();