{"id":27157725,"url":"https://github.com/johnnychase/postmantestframework","last_synced_at":"2026-05-04T05:31:55.770Z","repository":{"id":286858560,"uuid":"962791439","full_name":"JohnnyChase/PostmanTestFramework","owner":"JohnnyChase","description":"An easier, and quicker, way to write postman tests.","archived":false,"fork":false,"pushed_at":"2025-04-08T17:28:06.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T18:32:27.359Z","etag":null,"topics":["postman","postmantest","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohnnyChase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-08T17:19:00.000Z","updated_at":"2025-04-08T17:28:51.000Z","dependencies_parsed_at":"2025-04-08T18:43:30.797Z","dependency_job_id":null,"html_url":"https://github.com/JohnnyChase/PostmanTestFramework","commit_stats":null,"previous_names":["johnnychase/postmantestframework"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyChase%2FPostmanTestFramework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyChase%2FPostmanTestFramework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyChase%2FPostmanTestFramework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyChase%2FPostmanTestFramework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnnyChase","download_url":"https://codeload.github.com/JohnnyChase/PostmanTestFramework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247934170,"owners_count":21020714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postman","postmantest","testing-tools"],"created_at":"2025-04-08T21:35:57.512Z","updated_at":"2026-05-04T05:31:55.730Z","avatar_url":"https://github.com/JohnnyChase.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test Framework Documentation\n\n## Initial Setup\nFirst, create a 'setup' request -- this can be a call to google.com, it doesn't matter.\n\nInside of 'pre-request scripts' copy the entire contents of framework.js.\n\nThen hit \"Send\". This will compile the test framework and store it as a global variable.\n\nSecond, create some tests by adding this line of code to the top of your post-request scripts:\n\nconst Test = eval('(' + pm.globals.get('testFramework') + ')');\n\nAll done!\n\n## Response Code Tests\n\n### ResponseCode(code)\nTests if the response status code matches the expected code.\n\nTest.ResponseCode(200); // Tests if response is 200\n\n### Shorthand Response Code Methods\nConvenience methods for common response codes:\n\nTest.Response200(); // Success\nTest.Response201(); // Created\nTest.Response204(); // No Content\nTest.Response400(); // Bad Request\nTest.Response401(); // Unauthorized\nTest.Response403(); // Forbidden\nTest.Response404(); // Not Found\n\n## Value Tests\n\n### IsNull(whitelist, fuzzySearch = false)\nTests if specified fields are null.\n\n// Single field\n\nTest.IsNull('userId');\n\n// Multiple fields\n\nTest.IsNull(['userId', 'email']);\n\n// With fuzzy search\n\nTest.IsNull('user', true); // Will match 'user.id', 'user.email', etc.\n\n### IsNotNull(whitelist, fuzzySearch = false)\nTests if specified fields are not null and not empty.\n\n// Single field\n\nTest.IsNotNull('userId');\n\n\n// Multiple fields\n\nTest.IsNotNull(['userId', 'email']);\n\n\n// With fuzzy search\n\nTest.IsNotNull('user', true); // Will match all user.* properties\n\n### IsEqual(field, expected)\nTests if a field equals an expected value.\n\nTest.IsEqual('user.age', 25);\nTest.IsEqual('status', 'active');\n\n### IsNotEqual(field, expected)\nTests if a field does not equal a specific value.\n\nTest.IsNotEqual('user.status', 'deleted');\n\n### IsGreaterThan(field, expected)\nTests if a field is greater than a value.\n\nTest.IsGreaterThan('user.age', 18);\nTest.IsGreaterThan('price', 0);\n\n### IsGreaterOrEqualTo(field, expected)\nTests if a field is greater than or equal to a value.\n\nTest.IsGreaterOrEqualTo('quantity', 1);\n\n### IsLessThan(field, expected)\nTests if a field is less than a value.\n\nTest.IsLessThan('errorCount', 5);\n\n### IsLessOrEqualTo(field, expected)\nTests if a field is less than or equal to a value.\n\nTest.IsLessOrEqualTo('page', 10);\n\n### AllResponseFieldsNotNull()\nTests that all fields in the response are not null.\n\nTest.AllResponseFieldsNotNull();\n\n## Performance Tests\n\n### ResponseTime(maxTime = 200)\nTests if the response time is below a threshold (default 200ms).\n\nTest.ResponseTime(); // Uses default 200ms\nTest.ResponseTime(500); // Custom threshold of 500ms\n\n## Variable Management\n\n### GetVariable(name)\nRetrieves a variable value.\n\nconst userId = Test.GetVariable('userId');\n\n### SetVariable(name, value)\nSets a variable value.\n\nTest.SetVariable('userId', '12345');\n\n### DeleteVariable(name)\nRemoves a variable.\n\nTest.DeleteVariable('tempVar');\n\n### Description(desc)\nSets a custom description for the next test.\n\nTest.Description('Custom test description');\nTest.Response200(); // Will use the custom description\n\n## Working with Nested Objects\n\nThe framework can handle nested objects using dot notation:\n\n// Given this response:\n{\n    \"user\": {\n        \"profile\": {\n            \"name\": \"John\",\n            \"age\": 30\n        }\n    }\n}\n\n// You can test:\n\nTest.IsNotNull('user.profile.name');\nTest.IsEqual('user.profile.age', 30);\n\n## Best Practices\n\n1. Custom Descriptions\n\n// Add custom descriptions for clarity\nTest.Description('User should be at least 18 years old');\nTest.IsGreaterOrEqualTo('user.age', 18);\n\n2. Group Related Tests\n\n// Test user profile completeness\nTest.IsNotNull([\n    'user.id',\n    'user.name',\n    'user.email',\n    'user.profile'\n]);\n\n3. Response Validation\n\n// First check response code\nTest.Response200();\n\n// Then check data\nTest.IsNotNull('data');\nTest.IsEqual('data.status', 'success');\n\n## Complete Example\n\n// Initialize the framework\nconst Test = eval('(' + pm.globals.get('testFramework') + ')');\n\n// Check response code\nTest.Response200();\n\n// Check response time\nTest.ResponseTime(500);\n\n// Verify required fields exist\nTest.IsNotNull([\n    'data.id',\n    'data.user.name',\n    'data.user.email'\n]);\n\n// Check specific values\nTest.IsEqual('data.user.status', 'active');\nTest.IsGreaterThan('data.user.age', 18);\n\n// Store values for later use\nTest.SetVariable('userId', pm.response.json().data.id);\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnychase%2Fpostmantestframework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnnychase%2Fpostmantestframework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnychase%2Fpostmantestframework/lists"}