Skip to content

Anubhav9287/APITestingFramework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

APITestingFramework

This is a Java project/framework for API testing. In this project I have used two RAPID APIs.

  1. https://rapidapi.com/api-sports/api/covid-193
  2. https://rapidapi.com/symanto-symanto-default/api/sentiment-analysis9

Tech Stack Used:

  1. Java
  2. IDE: Eclipse
  3. Frameworks: Junit (testNg is almost similar)
  4. Report Generator: surefire
  5. Rest-assured
  6. Maven

Test Scenarios:

  1. Get all current statistics for USA.
  2. Detect the text-level sentiment.

RESULTS:

image

image

Challanges:

Creating POJO for statistics API. This is a difference in the given schema and the actual output.

  1. SCHEMA: { "type": "object", "properties": { "errors": { "type": "array" }, "get": { "type": "string" }, "parameters": { "type": "array" }, "response": { "type": "array", "items": { "type": "object", "properties": { "cases": { "type": "object" }, "country": { "type": "string" }, "day": { "format": "date", "type": "string" }, "deaths": { "type": "object" }, "tests": { "type": "object" }, "time": { "format": "date-time", "type": "string" } } } }, "results": { "type": "integer" } } }
  2. ACTUAL: { "errors": [], "get": "statistics", "parameters": [], "response": [ { "cases": { "1M_pop": "58", "active": 73, "critical": 3, "new": "+5", "recovered": 78315, "total": 83022 }, "continent": "Asia", "country": "China", "day": "2020-06-02", "deaths": { "1M_pop": "3", "new": null, "total": 4634 }, "population": 1439323776, "tests": { "1M_pop": null, "total": null }, "time": "2020-06-02T20:45:06+00:00" }, { "cases": { "1M_pop": "0.9", "active": 1, "critical": 0, "new": null, "recovered": 1, "total": 2 }, "continent": "Africa", "country": "Lesotho", "day": "2020-06-02", "deaths": { "1M_pop": null, "new": null, "total": 0 }, "population": null, "tests": { "1M_pop": null, "total": 283 }, "time": "2020-06-02T20:45:06+00:00" } ], "results": 227 }

Difference: continent and population were missing in schema.

HTML REPORT:

image

HOW TO RUN ?

  1. clone this project
  2. Install the dependency
  3. Verify project build is correct
  4. In run configuration: Run as maven build : clean test package site (This will clean the target, run the test, create a .jar file and create site as report.)

image

RUN THIS PROJECT

About

This is a Java custom framework for API testing. In this project I have used two RAPID APIs for testing. You can easily pull this code and start using it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors