brookshi / Hitchhiker

a Restful Api test tool
http://www.hitchhiker-api.com
Other
2.19k stars 402 forks source link

接口支持设置延时执行吗 #170

Closed liuyuf closed 6 years ago

liuyuf commented 6 years ago

希望能像jmeter一样支持加定时器

brookshi commented 6 years ago

是指压力测试那块吗

liuyuf commented 6 years ago

Schedulers 这块

brookshi commented 6 years ago

scheduler现在不是支持定时执行吗

liuyuf commented 6 years ago

是延时,比如要让某个接口延迟3秒再执行。3秒后执行这个接口以及接口后面的其他接口

brookshi commented 6 years ago

哦,这个功能可以在第一个接口里的pre request script里做,简单写个例子:

const deplay = function(time) {
    return new Promise((resolve, reject)=>setTimeout(resolve, time));
}
await deplay(3000);
liuyuf commented 6 years ago

await(deplay(3000)); 这样才没有报错 解决了