انتقل إلى المحتوى الرئيسي

إيقاف مؤقت

يوقف التنفيذ لمدة زمنية محددة. لا يُنصح باستخدام هذا الأمر للانتظار حتى يظهر عنصر ما. لتجنب نتائج الاختبار غير المستقرة، من الأفضل استخدام أوامر مثل waitForExist أو غيرها من أوامر waitFor*.

الاستخدام
browser.pause(milliseconds)
المعلمات
الاسمالنوعالتفاصيل
millisecondsnumberالوقت بالميلي ثانية
مثال
pause.js
it('should pause the execution', async () => {
const starttime = new Date().getTime()
await browser.pause(3000)
const endtime = new Date().getTime()
console.log(endtime - starttime) // outputs: 3000
});

Welcome! How can I help?

WebdriverIO AI Copilot