Skip to content

This Java Selenium framework automates UI, PostgreSQL database, and API testing for the Bookit demo app. It integrates Tabnine AI for code completion as well. It provides comprehensive testing across all layers, ensuring robust functionality and data integrity, making it an ideal resource for developers looking to enhance their automation skills.

Notifications You must be signed in to change notification settings

hiltas73/Bookit-ui-db-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project Overview

This project is a comprehensive testing framework developed using Java, Selenium, Maven, and Cucumber following the Behavior Driven Development (BDD) approach. It incorporates the Page Object Model and the Singleton Design Pattern to ensure maintainability and scalability. The framework is designed for testing a reservations application across three layers: UI, Database (PostgreSQL), and API.

Technologies and Tools Used

  • Java: The primary programming language used for developing the automation framework.

  • Selenium: An open-source tool for automating web browsers, enabling UI testing of web applications.

  • Maven: A build automation tool used for managing project dependencies and building the project.

  • Cucumber: A BDD framework that allows writing tests in a human-readable format using Gherkin syntax. It integrates seamlessly with Selenium for UI testing.

  • JUnit 4: A widely used testing framework for Java that provides assertions to validate expected outcomes in tests.

  • Page Object Model (POM): A design pattern that enhances test maintenance and reduces code duplication by creating an object repository for web elements.

  • Singleton Design Pattern: Ensures that a class has only one instance and provides a global point of access to it, particularly useful for managing WebDriver instances.

  • PostgreSQL: A powerful, open-source relational database used for storing test data and verifying database interactions.

  • RestAssured: A Java library for testing RESTful APIs, enabling easy verification of API responses.

  • Tabnine AI: Tabnine is the AI code assistant that you control — helping development teams of every size use AI to accelerate and simplify the software development process without sacrificing privacy, security, or compliance.

    • Tabnine provides intelligent, context-aware suggestions that adapt as I write, allowing for faster development and fewer errors. Its ability to suggest entire functions and generate code from natural language comments streamlined my workflow and improved overall productivity. By integrating Tabnine into my development environment, I was able to focus more on solving complex problems rather than getting bogged down by syntax and boilerplate code.

Project Structure

The project is organized into several key components:

  1. Feature Files: Located in the src/test/resources/features directory, these files contain scenarios written in Gherkin syntax that describe the expected behavior of the application.

  2. Step Definitions: Implementations of the steps defined in feature files, located in src/test/java/stepDefinitions.

  3. Page Objects: Classes that encapsulate the web elements and actions for each page of the application, located in src/test/java/pageObjects.

  4. Test Runner: A class responsible for executing Cucumber tests, configured to specify which feature files to run.

  5. Database Tests: Scripts that validate data integrity and interactions with the PostgreSQL database.

  6. API Tests: Tests that verify API endpoints using RestAssured, ensuring that they return expected responses.

Running Tests

To run the tests, navigate to the project directory in your terminal and use Maven commands:

mvn clean test

This command will execute all tests defined in your feature files. You can also run specific features by specifying their paths:

mvn test -Dcucumber.options="classpath:features/your_feature_file.feature"

You can also specify the environment information from terminal:

mvn test -Denvironment=qa3

Conclusion

This project serves as a robust framework for testing web applications through UI, database, and API layers. By leveraging modern technologies and design patterns, it ensures efficient test execution and maintenance.

For further details or inquiries, you can connect with the author on LinkedIn: Halim Iltas.

About

This Java Selenium framework automates UI, PostgreSQL database, and API testing for the Bookit demo app. It integrates Tabnine AI for code completion as well. It provides comprehensive testing across all layers, ensuring robust functionality and data integrity, making it an ideal resource for developers looking to enhance their automation skills.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published