SDK

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:
NameTypeDescription
millisecondsnumberThe 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:
NameTypeAttributesDescription
checkFuncSDK.ConditionThe condition that must be met.
timeoutnumber <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>