Methods

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

Introduce a delay in milliseconds.

Parameters:
NameTypeDescription
msnumber

The duration of the delay in milliseconds.

Returns:
  • A Promise that resolves after the delay.
Type: 
Promise.<void>

(async) generateK6Script(scriptContent, scriptTypeopt, overwriteopt) → {Promise.<string>}

Generates a temporary k6 script file.

Parameters:
NameTypeAttributesDefaultDescription
scriptContentstring

The content of the k6 script.

scriptTypestring<optional>
'load'

Type of script (e.g., 'load').

overwriteboolean<optional>
false

Whether to overwrite the report file.

Returns:
  • Path to the generated k6 script file.
Type: 
Promise.<string>

(async) runK6Script(scriptPath, overwriteopt) → {Promise.<{stdout: string, stderr: string, code: number}>}

Runs the k6 script with custom branding.

Parameters:
NameTypeAttributesDefaultDescription
scriptPathstring

Path to the k6 script file.

overwriteboolean<optional>
false

Whether to overwrite the report file.

Returns:
  • k6 execution result.
Type: 
Promise.<{stdout: string, stderr: string, code: number}>