The REST Assured Code Generator is a simple Next.js application designed to streamline the process of generating REST Assured test code. By inputting the necessary parameters, users can quickly obtain a code snippet that can be used to test APIs. This single-page application focuses on simplicity and efficiency, making it easier for users to create test cases without unnecessary complexity.
-
Input Fields:
- Base URL: Text box for entering the base URL of the API.
- API Endpoint: Text box for entering the specific API endpoint.
- Query Parameters: Two text boxes (key and value) with a "+" button to add more parameters as needed.
- Path Parameters: Text box for entering path parameters with a "+" button to add additional parameters.
- Headers: Similar to query parameters, allows for key-value pairs with the option to add more.
- Request Body: A dropdown to choose between JSON and form-data formats, along with an appropriate text area for input.
- Expected Status Code: A searchable dropdown listing all possible HTTP status codes.
-
User Interface:
- The left side of the application contains all input fields for user convenience.
- The right side displays the generated REST Assured code snippet along with a "Copy Code" button.
-
Code Generation:
- On clicking the "Generate Code" button, the application compiles all the input data into a well-structured REST Assured test code.
- Node.js (version 14 or later)
- npm (version 5.6 or later)
-
Clone the repository:
git clone https://github.com/osandadeshan/rest-assured-code-generator.git cd rest-assured-code-generator
-
Install the dependencies:
npm install
- Start the development server:
npm run dev
- Open your web browser and navigate to
http://localhost:3000
to view the application.
- Enter the Base URL and API Endpoint in the provided text boxes.
- Add Query Parameters and Path Parameters using the "+" buttons.
- Enter any necessary Headers.
- Select the appropriate Request Body Type (JSON or form-data) and provide the body content if required.
- Enter the Expected Status Code.
- Click the Generate Code button to create the REST Assured test code.
- Use the Copy Code button to easily copy the generated code to your clipboard for further use.
- Next.js
- React
- TypeScript
- CSS (for styling)
The application is deployed on Vercel. You can try it out here.
This project is licensed under the MIT License. You are free to use, modify, and distribute this software under the terms of the license.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.
- Inspired by the need for efficient API testing and automation.
- Thanks to the open-source community for their valuable tools and resources.