An open API service indexing awesome lists of open source software.

https://github.com/jagatheshwarann/cucumberbdd-test-framework

This repository contains a Cucumber BDD-based Automation Framework built using Java, Selenium WebDriver, and TestNG, designed to streamline the testing of web applications. The framework promotes collaboration through human-readable feature files and is adaptable to suit the requirements of any modern BDD-driven automation project.
https://github.com/jagatheshwarann/cucumberbdd-test-framework

aes-encryption ashot bdd-framework cucumber cucumber-java cucumber-report gherkin java log4j2 maven page-object-model pico-container restassured selenium selenium-webdriver testng

Last synced: 3 months ago
JSON representation

This repository contains a Cucumber BDD-based Automation Framework built using Java, Selenium WebDriver, and TestNG, designed to streamline the testing of web applications. The framework promotes collaboration through human-readable feature files and is adaptable to suit the requirements of any modern BDD-driven automation project.

Awesome Lists containing this project

README

          

# ๐Ÿ–ฅ๏ธ Cucumber BDD Test Framework

## ๐Ÿ“– Overview

This repository contains a Cucumber BDD-based Test Automation Framework built using Java, Selenium WebDriver, and TestNG. It supports Behavior-Driven Development (BDD) for web application testing, enabling collaboration between technical and non-technical stakeholders through human-readable feature files. The framework is modular, scalable, and maintainable, with a clear separation of concerns. It integrates custom services, utility classes, page components, and step definitions, and supports both UI and API testing, data-driven testing, and service layer validation, making it adaptable for a wide range of automation projects.

---

## โœจ Key Features

๐Ÿงช **Behavior-Driven Development (BDD)** with Cucumber and Gherkin syntax
โš™๏ธ **Modular Page Object Model (POM)** for UI automation
๐Ÿ”„ **Data-Driven Testing** using Excel and Custom DataTable Mappers
๐Ÿ”— **Service Layer Support** for API interaction and validation
๐Ÿ” **Custom Parameter & Data Table Type Bindings** for reusable step logic
๐Ÿงฉ **Hooks and Context Management** for clean stateful execution
๐Ÿ“ธ **Screenshot Capture and Logging** integrated with step failures
๐Ÿ“Š **Advanced Reporting** using ExtentReports
๐Ÿ”ง **Multiple Environments** via `stage.properties`, `prod.properties`
๐Ÿš€ **TestNG and Cucumber CLI Runners** for flexible execution
๐ŸŒ **Selenium WebDriver** for automated browser interaction
๐Ÿ” **AES Encryption** for encryption and decryption of sensitive data

---

## ๐Ÿ”ง Prerequisites

Before running the framework, ensure the following tools are installed on your system:

โœ… Java 11 or higher
โœ… Maven (for dependency management)
โœ… IDE (e.g., IntelliJ IDEA, Eclipse)

---

## ๐Ÿš€ Getting Started

Follow the steps below to set up and execute your tests using the **Cucumber BDD Test Framework**.

---

### 1๏ธโƒฃ Clone the Repository

```bash
git clone https://github.com/JagatheshwaranN/CucumberBDDTestFramework.git
```

---

### 2๏ธโƒฃ Set Up the Project

Navigate to the project directory and run the following Maven command:

```bash
mvn clean install
```

This will download all required dependencies and compile the project.

---

### 3๏ธโƒฃ Run Tests

You can execute your tests using Maven with custom parameters:

```bash
mvn test -DBrowser=Chrome -DRunType=Local -Dorg.freemarker.loggerLibrary=NONE -DFULL_PAGE_SCREENSHOT=No
```

**Parameters:**
- `Browser` โ†’ Specify the browser (e.g., Chrome, Firefox)
- `RunType` โ†’ Choose between Local or Remote execution
- `FULL_PAGE_SCREENSHOT` โ†’ Enable/Disable full-page screenshot capture

---

### 4๏ธโƒฃ Generating Reports

๐Ÿ“ Reports and logs will be auto-generated after test execution:

โœ… **Cucumber HTML Report** โ†’ `/target/cucumber`
โœ… **ExtentReports HTML Report** โ†’ `/target/reports`
โœ… **TestNG HTML Report** โ†’ `/target/surefire-reports`
โœ… **Screenshots for failed steps** โ†’ `/resources/screenshots`
โœ… **Detailed Cucumber HTML Report** โ†’ `/target/cucumber-html-reports`

> ๐Ÿ”” **Note:**
> To generate the **Detailed Cucumber Report**, use the following command:
>
> ```bash
> mvn verify
> ```
> instead of:
> ```bash
> mvn test
> ```

---

## ๐Ÿค Contributions

Feel free to fork the repository, raise issues, or submit pull requests to enhance the framework further!

---

## ๐Ÿง‘๐Ÿป Maintainer

Built and maintained with โค๏ธ by **Jagatheshwaran N**
GitHub: [@JagatheshwaranN](https://github.com/JagatheshwaranN)

---

## ๐Ÿ“œ License

This project is open-sourced under the [MIT License](LICENSE).

---

## ๐Ÿ“ Directory Structure

```plaintext
CucumberBDDTestFramework/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ main/
โ”‚ โ”‚ โ”œโ”€โ”€ java/
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ com/
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ qa/
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ctf/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ base/
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ElementActions
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ Page
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ PageComponent
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ constant/
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ BrowserType
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ RunType
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ TestConstants
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ context/
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ TestContext
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ factory/
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ BrowserFactory
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ DriverFactory
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ RunFactory
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ handler/
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ AlertHandler
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ BrowserHandler
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ DateTimeHandler
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ DropDownHandler
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ InteractionHandler
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ JavaScriptHandler
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ VerificationHandler
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ WaitHandler
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ hook/
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ TestHook
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ service/
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ CookieMapper
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ServiceRequest
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ SpecBuilder
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ util/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ EncryptionManager
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ExcelReader
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ExceptionHub
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ FileReader
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ScreenCapture
โ”‚ โ””โ”€โ”€ resources/
โ”‚ โ””โ”€โ”€ log4j2.properties
โ”œโ”€โ”€ test/
โ”‚ โ”œโ”€โ”€ java/
โ”‚ โ”‚ โ””โ”€โ”€ com/
โ”‚ โ”‚ โ””โ”€โ”€ qa/
โ”‚ โ”‚ โ””โ”€โ”€ ctf/
โ”‚ โ”‚ โ””โ”€โ”€ app/
โ”‚ โ”‚ โ”œโ”€โ”€ Cookies
โ”‚ โ”‚ โ”œโ”€โ”€ CustomDataTableType
โ”‚ โ”‚ โ”œโ”€โ”€ CustomParameterType
โ”‚ โ”‚ โ”œโ”€โ”€ base/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ PageBase
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ PageFactory
โ”‚ โ”‚ โ”œโ”€โ”€ constant/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ Endpoint
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ Message
โ”‚ โ”‚ โ”œโ”€โ”€ context/
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ AppContext
โ”‚ โ”‚ โ”œโ”€โ”€ domain/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ BillingDetails
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ExcelDataToDataTable
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ Product
โ”‚ โ”‚ โ”œโ”€โ”€ objects/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ AccountPageObject
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ CartPageObject
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ CheckoutPageObject
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ LoginPageObject
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ StorePageObject
โ”‚ โ”‚ โ”œโ”€โ”€ pages/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ AccountPage
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ CartPage
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ CheckoutPage
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ LoginPage
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ StorePage
โ”‚ โ”‚ โ”œโ”€โ”€ runner/
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ TestNGRunnerTest
โ”‚ โ”‚ โ”œโ”€โ”€ service/
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ CartService
โ”‚ โ”‚ โ””โ”€โ”€ steps/
โ”‚ โ”‚ โ”œโ”€โ”€ BaseSteps
โ”‚ โ”‚ โ”œโ”€โ”€ CartSteps
โ”‚ โ”‚ โ”œโ”€โ”€ CheckoutSteps
โ”‚ โ”‚ โ”œโ”€โ”€ CustomerSteps
โ”‚ โ”‚ โ”œโ”€โ”€ LoginSteps
โ”‚ โ”‚ โ””โ”€โ”€ StoreSteps
โ”‚ โ””โ”€โ”€ resources/
โ”‚ โ”œโ”€โ”€ config/
โ”‚ โ”‚ โ”œโ”€โ”€ prod.properties
โ”‚ โ”‚ โ””โ”€โ”€ stage.properties
โ”‚ โ”œโ”€โ”€ data/
โ”‚ โ”‚ โ””โ”€โ”€ testData.xlsx
โ”‚ โ”œโ”€โ”€ features/
โ”‚ โ”‚ โ”œโ”€โ”€ AddToCartOnStore.feature
โ”‚ โ”‚ โ”œโ”€โ”€ LoginToStore.feature
โ”‚ โ”‚ โ”œโ”€โ”€ PlaceOrderAsGuest.feature
โ”‚ โ”‚ โ”œโ”€โ”€ PlaceOrderAsGuestByService.feature
โ”‚ โ”‚ โ””โ”€โ”€ PlaceOrderWithExcelDataAsGuest.feature
โ”‚ โ”œโ”€โ”€ logs/
โ”‚ โ”‚ โ””โ”€โ”€ AutomationExecution.log
โ”‚ โ”œโ”€โ”€ screenshots/
| | โ””โ”€โ”€ 19_03_2025_11_21_07.png
โ”‚ โ”œโ”€โ”€ xml/
โ”‚ | โ””โ”€โ”€ testNG.xml
โ”‚ โ”œโ”€โ”€ extent.properties
โ”‚ โ”œโ”€โ”€ cucumber.properties
โ”‚ โ”œโ”€โ”€ html-config.xml
โ”‚ โ”œโ”€โ”€ pdf-config.yaml
โ”‚ โ””โ”€โ”€ spark-config.xml
โ””โ”€โ”€ pom.xml