[GH-ISSUE #3693] [feature]: add setTimeout to the available script functions #1277

Open
opened 2026-03-16 19:35:02 +03:00 by kerem · 2 comments
Owner

Originally created by @yvz5 on GitHub (Dec 22, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3693

Is there an existing issue for this?

  • I have searched the existing issues

Summary

I want to run tests with a delay. Postman allows me to wrap the test function inside a setTimeout to delay the execution. I would like to have similar mechanism.

example:

setTimeout(function(){
  pw.test("Status code is 200", ()=> {  
      pw.expect(pw.response.status).toBe(200);    
  });
}, 15000);

Why should this be worked on?

some api calls take time to actually save the data. if you create the data and immediately call another endpoint to get the data (to be sure it worked) it doesnt give you the expected result because some endpoints take some time to finish. in these cases it is very useful to run Tests in a delayed fashion.
1- create a resource
2- wait for 2 seconds
3- run the test to get the resource you just created.

Originally created by @yvz5 on GitHub (Dec 22, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3693 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Summary I want to run tests with a delay. Postman allows me to wrap the test function inside a `setTimeout` to delay the execution. I would like to have similar mechanism. example: ``` setTimeout(function(){ pw.test("Status code is 200", ()=> { pw.expect(pw.response.status).toBe(200); }); }, 15000); ``` ### Why should this be worked on? some api calls take time to actually save the data. if you create the data and immediately call another endpoint to get the data (to be sure it worked) it doesnt give you the expected result because some endpoints take some time to finish. in these cases it is very useful to run `Tests` in a delayed fashion. 1- create a resource 2- wait for 2 seconds 3- run the test to get the resource you just created.
Author
Owner

@floric commented on GitHub (Apr 17, 2025):

Is there any chance for this? We would benefit a lot from this feature.

<!-- gh-comment-id:2812176379 --> @floric commented on GitHub (Apr 17, 2025): Is there any chance for this? We would benefit a lot from this feature.
Author
Owner

@floric commented on GitHub (Oct 16, 2025):

Hey :) this is still open. Is there any chance? Maybe for an open source contribution?

<!-- gh-comment-id:3410458302 --> @floric commented on GitHub (Oct 16, 2025): Hey :) this is still open. Is there any chance? Maybe for an open source contribution?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1277
No description provided.