UNPKG

@labnex/cli

Version:

CLI for Labnex, an AI-Powered Testing Automation Platform

23 lines 905 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleWait = handleWait; async function handleWait(page, addLog, selectorOrTimeout, timeoutMs = 10000) { if (!page) throw new Error('Page context not available for wait.'); if (typeof selectorOrTimeout === 'number' || !selectorOrTimeout) { const waitTime = selectorOrTimeout || 3000; addLog(`Waiting for ${waitTime}ms`); await new Promise(res => setTimeout(res, waitTime)); return; } const selector = selectorOrTimeout; addLog(`[HandleWait] Waiting for selector: ${selector} (timeout ${timeoutMs}ms)`); try { await page.waitForSelector(selector, { timeout: timeoutMs }); addLog('[HandleWait] Selector appeared.'); } catch { addLog('[HandleWait] Timeout waiting for selector.'); } } //# sourceMappingURL=handleWait.js.map