إيقاف مؤقت
يوقف التنفيذ لمدة زمنية محددة. لا يُنصح باستخدام هذا الأمر للانتظار حتى يظهر عنصر ما. لتجنب نتائج الاختبار غير المستقرة، من الأفضل استخدام أوامر مثل
waitForExist
أو غيرها من أوامر waitFor*.
الاستخدام
browser.pause(milliseconds)
المعلمات
الاسم | النوع | التفاصيل |
---|---|---|
milliseconds | number | الوقت بالميلي ثانية |
مثال
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
});