This framework is developed using Behavior-Driven Development (BDD) principles with Cucumber and integrated with Extent Reports. It is designed specifically for automating REST APIs, providing robust reporting and flexibility for handling API responses and requests.
- Enables writing human-readable test scenarios that bridge the gap between non-technical stakeholders and developers.
- Generates visually appealing and detailed test reports with screenshots, logs, and results.
- The framework allows passing response values from one API request to another. Simply reference the value using the $ symbol as "$key" to inject it into subsequent API requests dynamically.
Logs are configured at a high level, printing detailed information for each test scenario, including:
- Scenario name
- Duration
- Execution status (pass/fail)
- Failure cause or error (if any)
- The framework can push scenario execution details (status, duration, errors) into a database for further analysis and tracking.
The framework connects with different SQL databases such as:
- Oracle
- DB2
- MySQL This allows for executing queries across various database environments and validating data integrity.
- The framework includes a Batches class, which executes Spring Batch jobs for batch processing use cases.
- Java 17 or higher
- Maven 3.6v or higher
- Junit 5.0v or higher
- RestAssured 5.4.0v or higher
- Cucumber 7.16v or higher
- Extent-reports 5.0v or higher
In the pom.xml, we have configured Extent reports and run the features by following different commands.
To build the project and download all dependencies, run the whole suite following Maven command:
mvn clean install
mvn clean install -Dcucumber.options="--features src/test/resources/features/placeValidations.feature"
mvn clean install -Dcucumber.options="--features src/test/resources/features/placeValidations.feature,src/test/resources/features/Example.feature"
mvn clean install -Dcucumber.options="--tags @Regression"
mvn clean install -Dcucumber.options="--features src/test/resources/features/placeValidations.feature --tags @Regression"
Select "This project is parameterized" and set below parameters.
- For 1st parameter, select String parameter and set below details:
- Name: Features
- Default value: src/test/resources/features
- Description: -- Pass the features path here by separated coma (,). -- By default, it will pick up all features.
- For 2nd parameter, select choice parameter and set below details:
- Name: Tags
- Choices: Regression, Smoke, Sanity
- Description: -- Choose the tags. By default Regression
- For Root POM, give as "pom.xml"
- For Goals and Options, use the following command:
clean verify -Dcucumber.options="--features ${Features} --tags @${Tags}"
- Go to "Advanced" and check the "use custom workspace". Add project directory path.
Note: Add project path in the custom workspace field and Also remainings as per requirements.