/RestAssuredFramework

This is API Automation Framework using Rest Assured Library And Java. I have used TestNG framework to manage tests. This is maven based project which contain all core classes and scalable architecture.

Primary LanguageHTML

Framework Development

Framework - maintain all project related files.

Objectives:

  1. Re-Usability

  2. Maintainability

  3. Readability

Hybrid Driven

Phases of design and development of framework.

  1. Understanding requirement

    • Functional specifications (static)
    • Swagger
  2. Choose automation tool - Rest Assured Library

  3. Design your framework

    • Decide about folder structure.
    • Decide coding format and other policies.
    • Decide Configuration and utility classes.
  4. Development

    • Develop all decided design
  5. Execution + CI

Rest Assured Framework Design

Development

  • Endpoints - Routers, UserEndPoints, StoreEndPoints, PetEndPoints

  • Test Cases - User Tests, Store Tests, Pet Tests

  • Payloads(POJO) - User, Store, Pet

  • Utilities - DataProviders, Extent Report, XL Utility

  • Test Data - Userdata.xlsx, StoreData.xlsx, PetData.xlsx

Execution

  • TestNG.XML
  • POM.xml - Dependencies, Plugins
  • Reports - TestNG Reports, Extent Reports

CI

  • Git
  • GitHub
  • Jenkins

==========================================================

Step 1: Create Maven Project

Step 2: Update pom.xml with required dependencies

Step 3: Basic structure we need to create - Create folder Structure

Step 4: Create Endpoints.java which contain's url

Step 5: Create UserEndPoint.java =====> CRUD method implementation

Step 6: Create UserServiceHelper and read config files and creating reusable https methods.

Step 7: Create Data driven test - need data in excel sheet - need apache poi to read and write data - excelUtility file

Step 8: Generate extent reports - extent report utility. - testng.xml file

Step 9: Add execution logs to track log of execution. Add logs - log4j2 dependancy,

Step 10: How to get url from properties file and run it - checkout classes UserServiceHelperFromProperties, endpoints.properties, com.api.test.property.UserTests.java

Step 11: How to run project through Maven - Add two plugins in to pom.xml - maven-compiler-plugin and maven-surefire-plugin and add target testng.xml

Step 12: Command for run - mvn clean install test

Step 13: Run project from command prompt/terminal: Install maven in your system. - set maven path - go to project location in terminal and run mvn clean install test