How hiltas73/bookit-ui-db-api works
Project Type and Purpose
• This is an end-to-end automated testing framework built in Java using Selenium, Cucumber (BDD), RestAssured (API), and JDBC/PostgreSQL (DB).
• It validates a reservations application across three layers: UI, API, and Database.
File Structure
• src/test/resources/features: Gherkin feature files (UI and API scenarios).
• src/test/java/com/bookit/stepDefinitions: Cucumber step definitions (UIStepDefinitions, APIStepDefinitions, Hooks).
• src/test/java/com/bookit/pages: Page Object Model classes representing UI pages (SignInPage, SelfPage, TopNavigationBar).
• src/test/java/com/bookit/runners: Test runner classes that configure and kick off Cucumber tests.
• src/test/java/com/bookit/utilities: Helpers (Driver singleton, ConfigurationReader, DBUtil, RestAssured wrappers in BookitUtils, BrowserUtils).
• src/test/resources/Environments: environment-specific property files (qa1.properties, qa2.properties, qa3.properties).
• configuration.properties & pom.xml: Maven configuration, dependencies, and default settings.
Extract Insights from README
• Uses Page Object Model to encapsulate locators and actions per page.
• Singleton pattern for WebDriver (Driver class).
• BDD via Cucumber: feature files → step definitions → Page Objects/utilities.
• Three testing layers: UI (Selenium), API (RestAssured), DB (JDBC/PostgreSQL).
Main Components & Their Relationships
a. Feature Files (Gherkin)
→ consumed by
b. Cucumber Test Runner
→ invokes
c. Step Definitions (UIStep, APIStep)
→ delegate to
d. Page Objects (UI interactions) and API utility methods
→ rely on
e. Utilities
• Driver (Singleton WebDriver)
• ConfigurationReader (environment selection)
• BrowserUtils (common Selenium actions)
• DBUtil (JDBC for PostgreSQL)
• BookitUtils (API calls via RestAssured)
f. External Systems
• Web Application under test (UI endpoints)
• REST API endpoints
• PostgreSQL Database
Architectural Patterns & Design Principles
• BDD: Clear separation between feature definitions (behavior) and implementation (step definitions).
• Page Object Model: Encapsulation of page elements and UI actions.
• Singleton: Single WebDriver instance across tests.
• Layered Testing Architecture: UI layer, API layer, DB layer.