Skip to content

This is a test automation framework using Rest-Assured for API testing, Cucumber for BDD, and ExtentReports for reporting. The framework allows automated API tests using the Cucumber BDD approach while generating detailed HTML reports with Extent Reports.

License

Notifications You must be signed in to change notification settings

kulwinder-singh17/api-test-using-bdd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rest-Assured Cucumber BDD Framework with Extent Reports

This is a test automation framework using Rest-Assured for API testing, Cucumber for BDD, and ExtentReports for reporting. The framework allows automated API tests using the Cucumber BDD approach while generating detailed HTML reports with Extent Reports.

Table of Contents

Project Setup

Prerequisites:

  1. Java 8+
  2. Maven - To manage dependencies
  3. IDE (e.g., IntelliJ, Eclipse)

Libraries and Tools Used:

  • Rest-Assured: For API Testing
  • Cucumber: For Behavior-Driven Development (BDD)
  • JUnit: To execute Cucumber tests
  • ExtentReports: For detailed HTML test reports

Installation

  1. Clone the repository:

    git clone https://github.com/kulwinder-singh17/restassured-cucumber-bdd.git
    cd restassured-cucumber-bdd
  2. Install dependencies via Maven:

    mvn clean install

Project Structure

src/
├── main/
│   └── java/
│       └── com/
│           └── yourcompany/
│               └── utils/
│               │    ├── ExtentManager.java
│               │    └── ExtentTestManager.java
│               └── base/
│                    └── ApiService.java
├── test/
│   └── java/
│       └── com/
│           └── yourcompany/
│               ├── hooks/
│               │   └── Hooks.java
│               ├── steps/
│               │   └── Steps.java
│               └── runners/
│               │   └── Runner.java
│               └── features/
│                   └── city.feature
└── resources/

How to Run the Tests

Using Maven:

To run the tests, execute the following command:

mvn test

Cucumber Feature File Example:

Feature: Weather API Testing

  Scenario Outline: Get current weather of "<City>"
    Given check weather of "<City>" using GET
    Then status code should be 200
    Examples:
      | City   |
      | London |
      | Mexico |
      | Mumbai |

License

This script is licensed under the Apache License. See LICENSE.md for more details.

About

This is a test automation framework using Rest-Assured for API testing, Cucumber for BDD, and ExtentReports for reporting. The framework allows automated API tests using the Cucumber BDD approach while generating detailed HTML reports with Extent Reports.

Topics

Resources

License

Stars

Watchers

Forks