ScriptStep
public class ScriptStep : Step
Step that runs some JavaScript which will return a result immediately from the JavaScript function.
The StepFlowResult returned by the handler can be used to drive control flow of the steps.
-
Initializer.
Declaration
Swift
public init( functionName: String, params: Any..., paramsKeys: [String] = [], handler: @escaping ScriptStepHandler )Parameters
functionNameThe name of the JavaScript function to call. The module namespace is automatically added.
paramsParameters which will be passed to the JavaScript function.
paramsKeysLook up the values from the JSON model dictionary using these keys, and pass them as the parameters to the JavaScript function. If provided, these are used instead of
params.handlerCallback function which returns data from JavaScript, and passes the model JSON dictionary for modification.
-
Declaration
Swift
public func run(with browser: Browser, model: JSON, completion: @escaping StepCompletionCallback)
View on GitHub
Install in Dash