Exporting Tests
Octrafic can export your executed API tests to multiple formats for use in other tools or CI pipelines.
How it works
After running tests, ask the AI to export them:
export these tests to postmansave the tests as a shell scriptOctrafic will generate the file and save it to ~/Documents/octrafic/tests/.
Supported formats
Postman Collection
Exports a Postman Collection v2.1 JSON file. Each test becomes a request item with method, URL, headers, and body. If tests were executed, response examples are included.
export tests to postman
export to postman and save as stripe-tests.jsonShell script (curl)
Exports a bash script with one curl command per test. The script includes a BASE_URL variable at the top for easy customization.
export tests as a shell scriptThe generated file is executable (chmod 755).
pytest
Exports a Python pytest file using the requests library. Each test becomes a test_METHOD_endpoint() function with assertions on the status code.
export tests as pytest
export to pytest and name it test_users_api.pyRequires Python dependencies to run:
pip install pytest requestsOutput location
Files are saved to:
~/Documents/octrafic/tests/You can also specify an absolute path:
export tests to postman at /tmp/my-tests.jsonAuthentication
All formats include the authentication configured for the session - Bearer token, API key, or Basic auth - so the exported files work out of the box.
Related
- PDF Reports - Generate PDF test reports
- Headless Mode - Run tests non-interactively
- Authentication - Configuring auth for API tests
