To learn more about using JavaScript in LeanFT, see Setting up and working with the JavaScript SDK.
For JavaScript code samples, see Code Samples - JavaScript.

SDK

SDK

SDK namespace - The LeanFT SDK base class.

Methods

delay(milliseconds) → {Promise.<void>}

Delays the execution of the next LeanFT command by the specified length of time (in milliseconds).
Parameters:
Name Type Description
milliseconds number The length of time (in milliseconds) to delay the execution of the next LeanFT command.
Returns:
a promise fulfilled when the length of time (in milliseconds) since the previous LeanFT command has passed.
Type
Promise.<void>

waitUntil(checkFunc, timeoutopt) → {Promise.<boolean>}

Waits until a certain condition is met (that is, waits until the specified checkFunc function is resolved to true), or the timeout elapses. This method is useful for synchronizing your test with your application.
Parameters:
Name Type Attributes Description
checkFunc SDK.Condition The condition that must be met.
timeout number <optional>
The length of time to wait (in milliseconds) to meet the condition.
Returns:
a promise fulfilled with true if checkFunc is resolved to true before the timeout is reached; otherwise, false.
Type
Promise.<boolean>

Type Definitions

Condition() → {boolean|Promise.<boolean>}

A function representing a condition to check in the waitUntil function.
Returns:
a boolean value or a promise fulfilled with a boolean value indicating whether the condition is met.
Type
boolean | Promise.<boolean>