A lightweight, ready-to-use Java Selenium automation framework pre-wired with Cucumber, TestNG, Maven and Allure reporting.
This repository contains a sample automation framework you can use as a starting point for web UI testing.
- Java + Maven project structure
- Selenium WebDriver utilities and driver manager
- TestNG test runner integration (
testng.xml
) - Cucumber feature files and step definitions
- Allure results collection (
allure-results/
) - Helpful utilities for API, DB, Excel, PDF and browser interactions
Important paths and purpose:
pom.xml
— Maven project descriptor with dependencies and pluginstestng.xml
— TestNG suite definition used by the projectsrc/test/java
— Java test sources, runners, step definitions and utilssrc/test/resources
— Test resources (feature files, config, log4j2)allure-results/
— Allure JSON results produced during test runstarget/
— Maven build output (should be ignored in VCS)
- Java JDK 11 or later installed and
JAVA_HOME
set - Maven 3.6+ on your PATH
- Browser driver(s) (e.g., ChromeDriver) — the project may include a driver manager utility; if not, download drivers and ensure they are available or configured by the framework
- (Optional) Allure commandline if you want to serve reports locally (
allure
)
On Windows you can verify Java and Maven using:
java -version
mvn -v
src/test/resources/config.properties
contains framework configuration (base URL, timeouts, credentials, etc.). Update values for your environment.- Logging configuration is in
src/test/resources/log4j2.xml
.
Sensitive values (API keys, passwords) should be injected via environment variables or a secure secrets store in CI; avoid committing secrets into config.properties
.
Run the full test suite (TestNG + Cucumber) using Maven:
mvn clean test -Dsurefire.suiteXmlFiles=testng.xml
Run a specific TestNG class or method using Surefire (example):
mvn -Dtest=com.framework.runners.TestRunner test
Generate / view Allure report locally (requires Allure CLI installed):
mvn clean test -Dsurefire.suiteXmlFiles=testng.xml
allure serve allure-results
If the project uses a custom Maven profile or properties, check pom.xml
for available options.
- The repo includes a
Dockerfile
for containerized execution. Adjust as needed for your CI environment. - In CI, ensure
JAVA_HOME
andMAVEN_HOME
are set, and add browser drivers or run tests against a remote Selenium Grid / Playwright / Selenoid service. - To publish Allure reports in CI, collect the
allure-results
directory as a build artifact and use an Allure plugin or post-build step to generate the HTML report.
- Tests fail to start: ensure the correct Java version and Maven are on PATH.
- Browser not found / driver error: download matching browser driver and either put it on PATH or configure the framework's driver utility.
- Flaky tests: investigate waiter/timeout usage in
BrowserUtils
and page objects; use explicit waits where appropriate.
- Remove committed generated artifacts and test outputs from history (e.g.,
target/
,allure-results/
,test-classes/
,.class
files). They should be ignored by.gitignore
and not tracked.- Example to untrack and remove them from the index:
git rm -r --cached allure-results target test-classes || echo "some paths not present"
git add .gitignore
git commit -m "Remove generated artifacts from VCS and update .gitignore"
git push origin main
- Add
README.md
(this file) and aLICENSE
that fits your intended project usage. - Consider a small CI workflow (GitHub Actions) that builds the project and runs tests on pull requests.
Contributions are welcome. Please open issues and pull requests. Keep changes focused and add tests when you modify framework behavior.
Add a license file to declare how this code may be used. If you want a permissive license, consider MIT
.
If you want, I can now:
- Remove the committed generated artifacts and push the cleanup commit.
- Add a
LICENSE
(MIT) and a shortCONTRIBUTING.md
. - Add a GitHub Actions workflow to run
mvn test
on push/pull requests.
Tell me which of the above you'd like me to do next.