Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anasss/api-testauto
An API testing automation suite using Spring boot, cucumber and Rest Assured.
https://github.com/anasss/api-testauto
cucumber java maven rest-api restassured springboot
Last synced: 28 days ago
JSON representation
An API testing automation suite using Spring boot, cucumber and Rest Assured.
- Host: GitHub
- URL: https://github.com/anasss/api-testauto
- Owner: Anasss
- License: gpl-3.0
- Created: 2024-05-08T15:27:59.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-08T16:14:35.000Z (6 months ago)
- Last Synced: 2024-10-11T03:02:04.049Z (28 days ago)
- Topics: cucumber, java, maven, rest-api, restassured, springboot
- Language: Java
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Github Actions](https://github.com/Anasss/api-testauto/actions/workflows/maven.yml/badge.svg)
# API Test AutomationThis repository contains an API testing automation suite using Spring Boot, Cucumber and Rest Assured.
The current feature is to test the Fixer time series API, which provides historical exchange rates.
See: https://apilayer.com/marketplace/fixer-apiThis suite can test other APIs by adding new feature files and step definitions.
## Testing approach
#### JSON Schema validation:
- We generate a JSON schema from our HTTP request expected reply.
- We check that the API returns the expected response code and matches the JSON Schema.
- We can also perform additional functional checks if needed.## Project Structure
- `src/main/java/com/api/testauto/steps`: Contains the Cucumber step definitions.
- `src/main/java/com/api/testauto/services`: Contains the services used in the step definitions.
- `src/main/java/com/api/testauto/utils`: Contains utility classes.
- `src/main/java/com/api/testauto/worlds`: Contains the world objects that share state between steps.## Setting up the project
To set up the project, you can execute the following commands:
```shell
git clone https://github.com/Anasss/api-testauto.git
cd api-testauto
mvn install
```You can launch the tests by executing the following command:
```shell
mvn test
```## Cucumber tag annotation
In Cucumber, tags are used to filter scenarios that you want to execute. You can add tags to your scenarios in your feature files using the `@test` For example:```gherkin
@test
Scenario Outline: Get valid historical rates between two valid dates
Given User makes a GET request to the Fixer API endpoint with and
Then The response matches the schema and the status code should be
```### Reference Documentation
For further reference, please consider the following sections:* [Cucumber](https://cucumber.io/docs)
* [Rest Assured](https://rest-assured.io/)
* [Spring Boot](https://docs.spring.io/spring-boot/docs/2.5.4/reference/htmlsingle/)
* [Maven](https://maven.apache.org/guides/index.html)