3.1 KiB
Automation API Testing Framework
This repository contains an Automation API Testing Framework built with Kotlin and Maven. The framework is designed to provide automated testing of RESTful API at https://restful-booker.herokuapp.com/.
Table of Contents
- Prerequisites
- Installation
- Project Structure
- Prerequisites for Testing
- Running Tests
- Reporting
- Contributing
- License
Prerequisites
Before you begin, ensure you have met the following requirements:
- You have installed JDK 17 or later.
- You have installed Maven.
- You have installed Git.
- IDE capable of running Kotlin. eg. Intellij, Eclipse (requires kotlin plugin), VS Studio (requires kotlin plugin) [although it is possible to run from the command line]
Installation
- Clone the repository:
git clone https://github.com/your-username/automation-api-testing-framework.git - Navigate to the project directory:
cd automation-api-testing-framework - Install the dependencies:
mvn -DskipTests=true package
Project Structure
The framework follows a standard Maven project structure:
automation-api-testing-framework
├── src
│ ├── main
│ │ └── kotlin
│ │ └── org
│ │ └── example
│ │ ├── api
│ │ ├── model
│ │ ├── storage
│ ├── test
│ │ └── kotlin
│ │ └── org
│ │ └── example
│ │ ├── utils
│ │ ├── ...
├── pom.xml
└── README.md
api: Api which is to be tested.model: data classes of the responses and requests for api.storage: caching class for storing api data.utils: Helper functions and utilities.
Prerequisites for Testing
Create a .env File
In the root directory of your project, create a file named .env. This file will hold all your environment-specific variables. For example:
API_USERNAME={username-here}
API_PASSWORD={password-here}
Running Tests
To run the tests, use the following Maven command:
mvn test
Reporting
Test output reports are generated in the app-info.html directory by default.
Contributing
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for using the Automation API Testing Framework! If you have any questions, feel free to open an issue or contact the project maintainers.