Skip to content

Commit

Permalink
Removed old comment
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeSavefrogs committed Feb 8, 2022
1 parent bcd0596 commit 659d032
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/SeleniumEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@
*
*
*
* Dalla versione 2.4 viene esportata nello scope globale in modo che possa essere usata anche nella Developer Console
* --------------------------------------------------------------------------------------------------------
*/
window.SeleniumEngine = {
waitUntil: function (testCondition, timeout_ms = 30000) {
/**
*
* @param {Function} testCondition
* @param {Number} timeout_ms
* @param {Number} checkInterval_ms
* @returns
*/
waitUntil: function (testCondition, timeout_ms = 30000, checkInterval_ms = 1000) {
let start_ts = performance.now();

return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -59,9 +65,10 @@
given_timeout: timeout_ms,
});
}
}, 1000);
}, checkInterval_ms);
});
},

/**
*
* @param {String} cssSelector The css selector for the element
Expand Down Expand Up @@ -91,6 +98,7 @@
.catch((result) => reject(result));
});
},

/**
*
* @param {String} cssSelector The css selector for the element
Expand All @@ -114,6 +122,12 @@
.catch((result) => reject(result));
});
},
sleep: (ms = 0) => new Promise((res) => setTimeout(res, ms)),

/**
*
* @param {Number} ms Time to wait (expressed in milliseconds)
* @returns Promise
*/
sleep: (ms = 0) => new Promise(res => setTimeout(res, ms)),
};
})(window);

0 comments on commit 659d032

Please sign in to comment.