Trafix is a modern, efficient API testing framework that simplifies the process of generating, executing, and managing API test cases. Built with a Go backend and Next.js frontend, APILUX delivers high performance, reliability, and an intuitive user experience.
- Dynamic Test Case Generation: Automatically create test cases based on provided API details.
- Interactive Frontend: A clean and responsive interface for managing test cases and viewing results.
- Test Case Customization: Edit, delete, or add new test cases seamlessly.
- Execution and Results Display: Execute test cases and review structured results, including status codes, response bodies, and execution times.
- Frontend Workflow
- Backend Workflow
- Backend Test Case Generation
- Usage
- License
- Future-Enhancements
- Contributing
-
API Information Form:
- Input fields for:
- Endpoint URL
- HTTP Method (GET, POST, PUT, DELETE)
- Headers (optional)
- Payload/Body (for POST/PUT requests)
- Input fields for:
-
Generated Test Cases Display:
- View autogenerated test cases, such as boundary tests and response validation tests.
-
Edit Test Cases:
- Modify, delete, or add new test cases.
-
Execute Test Cases:
- Click a button to execute all test cases.
-
View Results:
- Results displayed in a table format with:
- Test case name
- Status code
- Response body
- Execution time
- Results displayed in a table format with:
- Receiving API Info: API details are received from the frontend via the Go backend.
- Generating Test Cases:
- Predefined logic or AI APIs (e.g., OpenAI) create diverse test cases.
- Test cases are stored in a MongoDB database.
- Execution Trigger: A Kestra workflow is initiated with test case details.
- Execution and Storage:
- Test cases are executed, and results are stored in MongoDB.
- Results include response details like status codes and execution times.
-
Receive API Info:
- Endpoint:
/api/generate-test-cases
- Input: API details (URL, method, headers, payload)
- Validation: Ensure required fields are provided.
- Endpoint:
-
Generate Test Cases:
- Happy Path Tests: Valid inputs expected to succeed.
- Negative Tests: Invalid inputs (e.g., wrong data types, missing fields).
- Boundary Tests: Edge cases for parameters.
- Performance Tests: High payload or frequent requests.
-
Store Test Cases:
- Save test cases in the
test_cases
collection in MongoDB.
- Save test cases in the
-
Execute Test Cases:
- Endpoint:
/api/test-cases/run
- Trigger Kestra workflows for test execution.
- Endpoint:
After setting up the backend and frontend, you can start using APILUX to test APIs. Follow these steps to get started:
- Open your browser and navigate to the frontend at
http://localhost:3000
. - API Information Form: Enter the API details such as:
- Endpoint URL
- HTTP Method (GET, POST, PUT, DELETE)
- Headers (optional)
- Payload/Body (for POST/PUT requests)
- Generate Test Cases: The system will automatically generate test cases based on the provided API details.
- Modify Test Cases: You can edit, delete, or add new test cases as needed.
- Execute Tests: Click the "Run Tests" button to execute the test cases.
- View Results: The test results will be displayed, showing:
- Test Case Name/Description
- Status Code
- Execution Time
- Pass/Fail status
APILUX is licensed under the MIT License.
We have exciting plans to further improve APILUX and provide a more comprehensive API testing experience:
- Enhanced Reporting: Add more detailed analytics and insights for test case execution, such as visualized metrics and trends.
- Multiple Test Formats: Provide support for importing and exporting test cases in popular formats like Postman collections and Swagger files.
- Integration Testing: Extend the framework to include support for integration testing, enabling end-to-end validations.
- CI/CD Integration: Seamlessly integrate APILUX with CI/CD pipelines using tools like Jenkins, GitHub Actions, GitLab CI, and others.
APILUX is Open Source 🥳🥳
Feel free to reach out to us if you have any questions or ideas. We welcome contributions to Trafix! If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request to the
main
branch.
Please make sure your code follows the existing style and includes proper tests where applicable.
We encourage contributions from the community. Whether it's fixing a bug, adding a new feature, or improving documentation, your input is valuable. For any questions or feedback, feel free to open an issue or reach out to us.