Skip to content

A robust automation framework combining Cucumber, Selenium, JDBC, and TestNG for comprehensive UI and database testing. Features BDD, parallel testing, CI/CD integration, and detailed reporting.

License

Notifications You must be signed in to change notification settings

cihat-kose/cucumber-jdbc-ui-db-test-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cucumber JDBC UI and Database Test Lab

Cucumber Selenium TestNG JDBC Maven Java Jenkins Apache POI

📋 Table of Contents

  1. Introduction
  2. Features
  3. Applications Under Test
  4. Database Used
  5. Reporting
  6. Installation
  7. Configuration
  8. Usage
  9. Parallel Testing
  10. Folder Structure
  11. Dependencies
  12. Contributing
  13. License
  14. Contact

💡 Introduction

The cucumber-jdbc-ui-db-test-lab framework combines Cucumber for BDD, Selenium for UI testing, JDBC for database interactions, and TestNG for test execution. This robust automation solution is designed to facilitate thorough testing of both front-end and back-end aspects, with support for cross-browser compatibility and detailed reporting.

✨ Features

  • Behavior-Driven Development (BDD) with Cucumber and Gherkin syntax for easy-to-read test scenarios.
  • UI Automation using Selenium WebDriver, supporting Chrome, Firefox, Edge, and Safari browsers.
  • Database Testing through JDBC, allowing direct interactions with the database.
  • Apache POI Integration for reading and writing Excel files as test data sources.
  • Detailed Reporting in HTML and PDF formats using Extent Reports, with screenshots for failed scenarios.
  • Parallel Execution to expedite test runs across multiple threads.
  • Page Object Model (POM) structure for better maintainability and readability.
  • Jenkins CI/CD Integration for automated build and test pipelines.

🌐 Applications Under Test

This framework is designed to test two applications:

  1. Mersys Application: A comprehensive application that requires thorough UI and back-end testing.
  2. ZeroBank Application: An online banking platform used to simulate scenarios such as login, payee management, and foreign currency purchase.

💾 Database Used

This project uses the Sakila MySQL sample database for educational and testing purposes. It enables realistic database testing scenarios within the framework.

📝 Reporting

  • HTML and PDF Reports: Generated using Extent Reports and located in test-output and testReports.
  • ScenarioResults.xlsx: Captures the result of each test scenario, including the status and browser used. Managed through the Hooks class.

Example ScenarioResults.xlsx:

Scenario Name Status Browser
Login Test Passed Chrome
Search Test Failed Firefox
Checkout Test Passed Edge

📥 Installation

  1. Clone the repository:

    git clone https://github.com/cihat-kose/cucumber-jdbc-ui-db-test-lab.git
  2. Open in IntelliJ IDEA:

    • File > New > Project from Version Control
    • Enter the repository URL and click Clone.
  3. Ensure necessary plugins are installed:

    • Cucumber for Java and Gherkin plugins for IntelliJ IDEA.
  4. Wait for Maven dependencies to be downloaded and project setup to complete.

🔧 Configuration

  1. Database and Browser Configuration:

    • Update cucumber.properties with the database URL, username, password, and default browser:
      browser=chrome
      dbUrl=jdbc:mysql://localhost:3306/sakila
      dbUser=root
      dbPassword=password
  2. Extent Report Configuration:

    • Customize extent.properties for report and screenshot paths:
      reportPath=test-output/extent-report.html
      screenshotPath=test-output/screenshots/

⚙️ Usage

  1. Running Tests:

    • In IntelliJ IDEA, navigate to src/test/java.
    • Right-click any test file or directory and select Run 'TestName'.
  2. Jenkins Integration:

    • Set up a Jenkins job to automatically build and test the project. Steps:
      • Add a Maven project with clean test goals.
      • Configure source code management to link to this repository.
      • Add post-build actions to publish the HTML reports generated by Extent Reports.

⚡ Parallel Testing

To run tests in parallel, configure the ParallelTest.xml or use your own TestNG XML files with parallel attributes. This will allow concurrent execution of multiple test cases, speeding up the test suite.

📂 Folder Structure

cucumber-jdbc-ui-db-test-lab/
│
├── src/
│   ├── main/
│   └── test/
│       ├── java/
│       │   ├── apachePOI/           # Excel handling with Apache POI
│       │   ├── features/            # Cucumber feature files
│       │   ├── jdbc/                # JDBC related code
│       │   ├── pages/               # Page Object Model (POM) classes
│       │   ├── runners/             # TestNG runner classes
│       │   ├── stepDefinitions/     # Cucumber step definitions
│       │   ├── utilities/           # Utility classes
│       │   └── xml/                 # TestNG XML configurations
│       └── resources/
│           ├── cucumber.properties  # Cucumber configurations
│           └── extent.properties    # Extent report configurations
│
├── pom.xml                          # Maven configuration file
└── README.md                        # Project README file

📦 Dependencies

Essential dependencies in pom.xml include:

  • Selenium WebDriver for browser automation.
  • Cucumber for BDD using Gherkin syntax.
  • TestNG for test execution and parallel testing.
  • Apache POI for reading and writing Excel files.
  • MySQL Connector for database connectivity with JDBC.
  • Extent Reports for detailed reporting.
  • Java Faker for generating test data dynamically.

🤝 Contributing

We welcome contributions! To contribute:

  1. Fork this repository.
  2. Create a feature branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m 'Add 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

A robust automation framework combining Cucumber, Selenium, JDBC, and TestNG for comprehensive UI and database testing. Features BDD, parallel testing, CI/CD integration, and detailed reporting.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published