How pavleciric89/ui-api-test-automation-framework works
Project type and purpose
• This is a Java-based UI and API test automation framework built with Maven, Cucumber BDD, TestNG, Selenium WebDriver and REST-Assured.
• It orchestrates end-to-end UI tests (via page objects and Selenium) and API tests (via REST-Assured), then collates results into HTML reports.
File structure
• Top-level Maven project: pom.xml, src/main/java for reusable libraries (ApiUtils, pageObjects, utils), src/main/resources for configuration (config.properties).
• src/test/java contains the BDD test suite: feature files (src/test/resources/featureFiles), Cucumber step definitions (stepDefs), and the TestNG/Cucumber runner (MainRunner).
• Utilities: DriverFactory for WebDriver management; ReadConfigFile for loading endpoints, credentials.
• Build and execution artifacts: run.bat invokes the tests locally; target/ holds compiled classes, the JAR, and generated reports (cucumber-html-report, test-output).
README for additional insights
• Confirms exact tech stack and local execution entrypoint (run.bat → HTML report).
a. Main components
– Test Runner layer: Cucumber CLI + TestNG
– Feature Files (Gherkin)
– Glue Code: Step Definitions (UI_Steps, API_Steps, Hooks)
– Implementation libraries:
• UI Module: pageObjects + DriverFactory + Selenium WebDriver
• API Module: ApiUtils + REST-Assured
• Config Module: ReadConfigFile + config.properties
– External Systems Under Test:
• Web Application (UI endpoints)
• REST API endpoints
– Reporting:
• Cucumber HTML Reporter
• TestNG default reports
– Build & CI:
• Maven (pom.xml)
• Local runner (run.bat)
b. Relationships and interactions
1. run.bat → triggers “mvn test” → Cucumber/TestNG execution
2. Test Runner reads Feature Files → maps to Step Definitions
3. Step Definitions invoke either:
• UI Module → DriverFactory spins up WebDriver → interacts with Web Application via pageObjects
• API Module → REST-Assured calls API endpoints
4. Both modules log results back to TestNG/Cucumber engine
5. Reporting plugins generate HTML in target/cucumber-html-report and test-output
c. Architectural patterns
• BDD (Behavior-Driven Development) using Cucumber
• Page Object Model for UI abstraction
• Layered design (Feature → Steps → Implementation → External systems)
• Utility classes centralize driver and configuration management
d. Key technologies & libraries
• Java 8+
• Maven
• Cucumber BDD
• TestNG
• Selenium WebDriver
• REST-Assured
• HTML reporting plugins
Detail without over-splitting
• Every logical module (runner, steps, modules, utils) as its own component.
• Avoid putting every single class; group by package (e.g., pageObjects, ApiUtils).