Skip to content

Automated UI testing framework for ZeroBank using Cucumber, Selenium, and TestNG. Supports data-driven testing with Apache POI, covering login, payee management, and currency purchase features. Includes detailed HTML/PDF reporting, Jenkins integration, and cross-browser support.

License

Notifications You must be signed in to change notification settings

cihat-kose/zerobank-selenium-cucumber-ui-test-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZeroBank Selenium Cucumber UI Test Automation

Cucumber Selenium TestNG Maven Java Jenkins Apache POI

Table of Contents

  1. About the Project
  2. Key Benefits
  3. Features
  4. Application Under Test
  5. Reporting
  6. Installation
  7. Configuration
  8. Usage
  9. Parallel Testing
  10. Folder Structure
  11. Dependencies
  12. Contributing
  13. License
  14. Contact

About the Project

The ZeroBank Selenium Cucumber UI Test Automation framework is an automated testing solution created to validate various user scenarios on the ZeroBank platform. Designed to integrate Cucumber for Behavior-Driven Development (BDD), Selenium for UI automation, and TestNG for test execution and reporting, this framework enables efficient and consistent testing of core features such as login, payee management, and foreign currency purchases.

Additionally, this project serves as a practical resource for learners who are interested in mastering these technologies. By providing a real-world application of Selenium, Cucumber, TestNG, and Apache POI, the framework allows users to gain hands-on experience in automated UI testing, data-driven testing, and BDD practices.

Key Benefits

  • Automated UI Testing: Tests core functionalities such as login, adding a new payee, and foreign currency purchase.
  • Behavior-Driven Development (BDD): Test scenarios are defined in a readable format using Cucumber and Gherkin syntax.
  • Cross-Browser Testing: Tests can be run across different browsers to ensure compatibility.
  • Detailed Reporting: Generates HTML and PDF reports with test results, including screenshots of failed scenarios.
  • Data-Driven Testing with Apache POI: Supports parameterized testing by fetching test data from Excel files, leveraging Apache POI for seamless Excel integration. User credentials are retrieved from an Excel file for login scenarios, and test results are recorded in an Excel file for detailed tracking.
  • Page Object Model (POM): Simplifies test maintenance by using the POM design pattern.

Features

  • Login Functionality: Validates login functionality by retrieving the username and password from an Excel file using Apache POI.
  • Add New Payee: Automates adding a new payee with multiple data inputs.
  • Purchase Foreign Currency: Tests the currency purchase functionality with various currency types and amounts.
  • Data Table Support with Apache POI: Uses data tables for parameterized tests, allowing multiple sets of input. Apache POI is used to manage test data from Excel files.
  • Extent Reports: Generates HTML and PDF reports of the test results.
  • Parallel Testing: Supports parallel execution to speed up test runs.
  • Jenkins Integration: Easily integrate with Jenkins for continuous integration and delivery (CI/CD) processes.

Application Under Test

The application under test is ZeroBank, a demo banking application that provides various financial services. The framework tests functionalities such as login, online banking, and payee management to ensure these processes work as expected.

Reporting

Test results are stored in the test-output and testReports directories. Reports include:

  • HTML Report: Located at test-output/SparkReport/Spark.html.
  • PDF Report: Available at PdfReport.pdf for a summarized overview.

Additionally, test results are recorded in an Excel file using Apache POI. Each scenario’s name, status, and browser information are written to the Excel file, providing a detailed record of the test outcomes.

Installation

  1. Clone the repository:

    • Open IntelliJ IDEA.
    • Go to File > New > Project from Version Control.
    • Enter the repository URL: https://github.com/cihat-kose/zerobank-selenium-cucumber-ui-test-automation.git.
    • Click Clone.
  2. Install necessary plugins:

    • Ensure Cucumber for Java and Gherkin plugins are installed in IntelliJ IDEA for Cucumber and Gherkin syntax support:
      • Go to File > Settings > Plugins (or Preferences on macOS).
      • Search for Cucumber for Java and Gherkin, install them, and restart IntelliJ IDEA if prompted.
  3. Open the project:

    • IntelliJ IDEA should automatically detect and import the project as a Maven project.
    • Wait for dependencies to download.

Configuration

  • cucumber.properties: Configure Cucumber settings in src/test/resources/cucumber.properties:
    cucumber.publish.quiet=true
  • extent.properties: Configure ExtentReports settings in src/test/resources/extent.properties:
    extent.reporter.spark.start=true
    extent.reporter.spark.out=test-output/SparkReport/Spark.html

Usage

  1. Run tests:

    • Open the src/test/java directory in IntelliJ IDEA.
    • Right-click on any test file or directory and select Run 'TestName'.
  2. Jenkins Integration:

    • Integrate with Jenkins by creating a Jenkins job, adding a build step to run tests via Maven, and specifying clean test as the Maven goal.

Parallel Testing

To run tests in parallel, you can use TestNG XML files such as ParallelTest.xml. Right-click on the XML file in IntelliJ and select Run 'ParallelTest.xml'.

Folder Structure

zerobank-selenium-cucumber-ui-test-automation/
│
├── src/
│   ├── main/                   # Main source code
│   └── test/                   # Test source code
│       ├── java/
│       │   ├── apachePOI/      # Apache POI files and Excel data (e.g., ScenarioResults.xlsx, ZeroBankData.xlsx)
│       │   ├── features/       # Cucumber feature files
│       │   ├── pages/          # Page Object Model classes
│       │   ├── runners/        # TestNG runner classes
│       │   ├── stepDefinitions/# Cucumber step definitions
│       │   ├── utilities/      # Utility classes (e.g., DriverManager, ExcelUtility)
│       │   └── xml/            # XML configuration files for parallel testing
│       └── resources/
│           ├── cucumber.properties  # Cucumber configuration
│           └── extent.properties    # Extent report configuration
├── testReports/                # Folder for test reports
├── target/                     # Build output
└── pom.xml                     # Maven configuration file

Dependencies

The dependencies for this project are defined in the pom.xml file:

  • Selenium: Web browser automation
  • Cucumber: BDD testing framework
  • TestNG: Test execution and management
  • Apache POI: Excel data handling, used to manage test data for data-driven testing and to log test results.
  • ExtentReports: HTML and PDF reporting

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For questions or issues, please open an issue in this repository.

About

Automated UI testing framework for ZeroBank using Cucumber, Selenium, and TestNG. Supports data-driven testing with Apache POI, covering login, payee management, and currency purchase features. Includes detailed HTML/PDF reporting, Jenkins integration, and cross-browser support.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published