Giter Site home page Giter Site logo

anshul-sonpure / rest-assured-framework Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 61 KB

Java-based framework for testing RESTful APIs using the Rest Assured library. The framework provides a structured approach and utilities to streamline the creation and execution of API tests.

Home Page: https://medium.com/@theautobot/rest-api-and-rest-assured-tutorial-understanding-and-implementing-restful-web-services-33fd5659a09a

Java 13.26% HTML 55.32% CSS 20.03% JavaScript 11.39%
api-framework api-testing api-testing-framework java restassured-framework

rest-assured-framework's Introduction

Rest Assured Framework

This is a Java-based framework for testing RESTful APIs using the Rest Assured library. The framework includes a Java class file named GoRestEndPoint and a test script file named GoRestEndPointTest.

Getting Started

To use this framework, follow the steps below:

  • Clone the repository to your local machine.
  • Import the project into your IDE.
  • Modify the endpoint variable in the test methods to point to the API you want to test.
  • Run the test methods.

Usage

GoRestEndPoint Class

The GoRestEndPoint class contains a method named sendRequest that takes four parameters:

  • endpoint (String): The API endpoint to send the request to.
  • httpMethod (String): The HTTP method to use for the request (e.g. GET, POST, PATCH, DELETE).
  • payload (Object): The payload to include in the request (if applicable).
  • id (String): The ID of the request (for logging purposes). The method returns a Response object, which contains the response from the API.

GoRestEndPointTest Class

The GoRestEndPointTest class contains several test methods that use the GoRestEndPoint class to perform different HTTP methods (e.g. GET, POST, PATCH, DELETE) on the API. The responses from these requests are logged using a logger.

Dependencies

This framework requires the following dependencies:

  • RestAssured: To test REST APIs.
  • Log4j: To log the responses.
  • TestNG: To run the test methods.

Logging

The framework implements logging using Log4j. The logs are stored in the logs directory in the root of the project. Separate log files are generated for each test method.

Future Improvements

  • Add support for SOAP APIs.
  • Implement test data management using a data provider.
  • Add support for parallel test execution.
  • Implement reporting using a reporting tool such as ExtentReports.

Contributing

If you would like to contribute to this framework, please fork the repository and submit a pull request with your changes. We welcome all contributions and appreciate your help in making this framework even better!

Thank You
Happy Coding,
Learn,Code and Earn
Stay Safe and Stay Positive :)

rest-assured-framework's People

Contributors

anshul-sonpure avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

basantakb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.