tencent cloud

pts.step
Last updated: 2025-03-11 19:41:13
pts.step
Last updated: 2025-03-11 19:41:13
During the script execution, divide the process into different steps, and distinguish these steps in the final performance testing report.
step(name: string, callback: (() => void));

Parameters

Parameter
Type
Description
name
string
The information for identifying the name of the step.
callback
function
The function executed within the step, consisting of script statements that need to be executed.

Samples

Divide the script execution process into multiple steps:
import http from 'pts/http';
import { step } from 'pts';

export default function () {
step('get1', function () {
http.get('http://httpbin.org/get');
})
step('get2', function () {
http.get('http://httpbin.org/get');
})
step('get3', function () {
http.get('http://httpbin.org/get');
})
};

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback