-
Notifications
You must be signed in to change notification settings - Fork 0
Feature: Add pre-request and test scripts support #14
Copy link
Copy link
Open
Description
Description
Allow users to write JavaScript scripts that run before a request (pre-request) and after receiving a response (tests), similar to Postman.
Requirements
- Pre-request script editor
- Test script editor
- Built-in variables (request, response, environment)
- Assertion library (expect, assert)
- Console output panel
- Script templates/snippets
Example Usage
// Pre-request script
const timestamp = Date.now();
pm.environment.set("timestamp", timestamp);
// Test script
pm.test("Status is 200", function() {
pm.response.to.have.status(200);
});
pm.test("Response has user", function() {
const json = pm.response.json();
pm.expect(json.user).to.exist;
});Labels
enhancement, feature, frontend, backend
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels