Test Overview
This test checks if the Postman script correctly generates a current timestamp and verifies its format and value.
This test checks if the Postman script correctly generates a current timestamp and verifies its format and value.
pm.test("Timestamp is generated and valid", function () { const timestamp = Date.now(); pm.environment.set("currentTimestamp", timestamp); pm.expect(timestamp).to.be.a('number'); pm.expect(timestamp).to.be.above(0); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Postman test runner is ready to execute the test script | - | PASS |
| 2 | Generates current timestamp using Date.now() | Timestamp is a numeric value representing milliseconds since Unix epoch | Check that timestamp is a number | PASS |
| 3 | Stores timestamp in Postman environment variable 'currentTimestamp' | Environment variable 'currentTimestamp' holds the timestamp value | - | PASS |
| 4 | Asserts timestamp is greater than zero | Timestamp value is positive and valid | Verify timestamp > 0 | PASS |
| 5 | Test ends | Test completed successfully with all assertions passing | - | PASS |