https://github.com/cihat-kose/cucumber-practice-lessons
Created for QA learners: Realistic Cucumber BDD lessons using Selenium, TestNG and data-driven techniques with clear reporting and structure.
https://github.com/cihat-kose/cucumber-practice-lessons
apache-poi cucumber java java-selenium-testng-cucumber-maven maven selenium testng ui-test-automation
Last synced: about 1 month ago
JSON representation
Created for QA learners: Realistic Cucumber BDD lessons using Selenium, TestNG and data-driven techniques with clear reporting and structure.
- Host: GitHub
- URL: https://github.com/cihat-kose/cucumber-practice-lessons
- Owner: cihat-kose
- License: mit
- Created: 2023-03-31T22:34:18.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2025-11-22T16:58:23.000Z (6 months ago)
- Last Synced: 2026-01-24T03:34:44.596Z (4 months ago)
- Topics: apache-poi, cucumber, java, java-selenium-testng-cucumber-maven, maven, selenium, testng, ui-test-automation
- Language: Java
- Homepage: http://zero.webappsecurity.com/
- Size: 284 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cucumber Practice Lessons





## Table of Contents
1. [About the Project](#about-the-project)
2. [Key Benefits](#key-benefits)
3. [Features](#features)
4. [Application Under Test](#application-under-test)
5. [Reporting](#reporting)
6. [Installation](#installation)
7. [Configuration](#configuration)
8. [Usage](#usage)
9. [Parallel Testing](#parallel-testing)
10. [Folder Structure](#folder-structure)
11. [Dependencies](#dependencies)
12. [Contributing](#contributing)
13. [License](#license)
14. [Contact](#contact)
## About the Project
This repository contains step-by-step lessons for automating the [ZeroBank demo site](http://zero.webappsecurity.com) using **Selenium WebDriver**, **Cucumber**, and **TestNG**. It demonstrates common UI automation tasks such as logging in, adding payees and buying foreign currency. The examples follow the Page Object Model (POM) pattern and integrate data-driven testing with Apache POI.
## Key Benefits
- **Hands-On Practice** – Small scenarios focusing on essential automation concepts.
- **Behavior-Driven Development** – Feature files written in Gherkin provide clear, readable requirements.
- **Data-Driven** – Test data can be pulled from Excel files, and test results are logged back for tracking.
- **Rich Reporting** – Generates HTML, JSON, and ExtentReports output for easy analysis.
## Features
- **Login** – Validates login both with inline data and with credentials pulled from `ZeroBankData.xlsx`.
- **Add New Payee** – Demonstrates a data table with multiple payee inputs.
- **Purchase Foreign Currency** – Exercises the currency conversion workflow for several currencies.
- **Hooks and Utilities** – Capture screenshots on failure and record scenario results in Excel.
## Application Under Test
The lessons use the [ZeroBank demo application](http://zero.webappsecurity.com/login.html) to practice common banking tasks such as account login, paying bills and purchasing foreign currency.
## Reporting
- **Pretty Output** – All TestNG runners include the `pretty` plugin for clean console logs.
- **HTML/JSON Reports** – `TestRunnerSmokeWithHtmlAndJson` outputs HTML and JSON files in `target/reports`.
- **Extent Reports** – `TestRunnerExtentReport` creates a rich interactive report under `testReports/`.
- **Excel Logging** – `Hooks` writes scenario names, status and browser to `ScenarioResults.xlsx`.
## Installation
1. **Clone the repository**
```bash
git clone
```
2. **Install Java and Maven** – Java 21 and Maven must be available on your `PATH`.
3. **Download WebDriver binaries** for the browsers you wish to test (e.g. ChromeDriver or GeckoDriver) and ensure they are on the `PATH`.
## Configuration
- **extent.properties**
```properties
extent.reporter.spark.start=true
extent.reporter.spark.out=test-output/SparkReport/Spark.html
```
- Adjust browser selection in `DriverManager.java` if you want a different default.
## Usage
Run any of the runner classes with Maven:
```bash
mvn test -Dtest=TestRunnerAll
```
Other available runners: `TestRunnerSmoke`, `TestRunnerRegression`, `TestRunnerWithPlugin`, `TestRunnerSmokeWithHtmlAndJson`, and `TestRunnerExtentReport`.
## Parallel Testing
TestNG XML files (e.g. `ParallelTest.xml`) can be used for parallel execution. Right‑click the XML in your IDE and run it to start tests on multiple browsers.
## Folder Structure
```
src/test/java
├── apachePOI/ # Excel data files
├── features/ # Gherkin feature files
├── pages/ # Page Object classes
├── runners/ # TestNG runner classes
├── stepDefinitions/ # Glue code for features
└── utilities/ # Driver and Excel helpers
src/test/resources
└── extent.properties
```
Extent reports and HTML outputs are stored under `testReports/`, `target/`, or `test-output/`.
## Dependencies
Dependencies are declared in `pom.xml`, including Selenium, Cucumber, TestNG, Apache POI and ExtentReports.
## Contributing
1. Fork the project.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit your changes (`git commit -m 'Add feature'`).
4. Push and open a Pull Request.
## License
This project is licensed under the MIT License. See [LICENSE](LICENSE).
## Contact
Please open an issue for any questions or feedback.