fix(web-test): refine confirmation pause — remove from clickElement, reduce to 500ms in closeForm

clickElement confirmation handling is cleanup of stale dialogs — no pause needed.
closeForm confirmation is intentional user action — keep 500ms pause during recording
(on top of ~600ms from waitForStable = ~1.1s total dialog visibility).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-03-27 12:49:20 +03:00
parent d982c5082a
commit f5c02144cb
+1 -2
View File
@@ -1939,7 +1939,6 @@ export async function clickElement(text, { dblclick, table, toggle, expand, time
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 (recorder) await page.waitForTimeout(1500); // show confirmation dialog to viewer during recording
await page.mouse.click(btnResult.x, btnResult.y);
await waitForStable();
const state = await getFormState();
@@ -2275,7 +2274,7 @@ export async function closeForm({ save } = {}) {
for (const b of btns) {
const txt = (await b.textContent()).trim();
if (txt === label) {
if (recorder) await page.waitForTimeout(1500); // show confirmation to viewer during recording
if (recorder) await page.waitForTimeout(500); // show confirmation to viewer during recording
await b.click({ force: true });
await waitForStable(beforeForm);
break;