@testcomplete/sleep
Version:
A simple function which delays execution.
64 lines (38 loc) • 1.42 kB
Markdown
# TestComplete - Sleep
> A simple function which delays execution.
* **Version** : ``v0.1.3``
* **Compatibility** : **TestComplete** only
* **Script** : ``./node_modules/@testcomplete/sleep/Sleep.js``
* **Dependencies** :
* none
## Summary
[](BeginSummary)
* [Summary](#summary)
* [Sleep Setup for TestComplete](#sleep-setup-for-testcomplete)
* [Get Started](#get-started)
* [Delays execution ``Sleep()``](#delays-execution-sleep)
[](EndSummary)
## Sleep Setup for TestComplete
As this library is published on **npmjs**,
you can easily get library with the following command
if you have **nodejs** installed on your computer.
````bash
npm install @testcomplete/sleep
````
Please confer to this documentation to add script in TestComplete :
Script List for the setup :
* ``./node_modules/@testcomplete/sleep/Sleep.js``
[@testcomplete/testcompletelibrarysetup](https://www.npmjs.com/package/@testcomplete/testcompletelibrarysetup)
## Get Started
First of all, you have to add the script ``Sleep.js`` to your
script library in **TestComplete**.
````javascript
let Sleep = require(`Sleep`);
````
## Delays execution ``Sleep()``
The method ``Sleep( $nHours = 0, $nMinutes = 0, $nSeconds = 1, $nMilliSeconds = 0 )``
delays execution (in milliseconds) for specified time provided in arguments.
````javascript
// Wait for 10 seconds before continuing execution
Sleep(0, 0, 10, 0);
````