A simple Java-based BDD (Behavior-Driven Development) framework using Cucumber, suitable for demonstrating skills and CI/CD integration.
- Java 17
- Maven
- Cucumber 7 (JUnit 5 / JUnit Platform)
- GitHub Actions for CI
src/test/
├── java/com/example/bdd/
│ ├── RunCucumberTest.java # JUnit 5 test runner
│ ├── Calculator.java # Domain (demo)
│ ├── CalculatorStepDefs.java # Calculator steps
│ └── LoginStepDefs.java # Login steps
└── resources/com/example/bdd/
├── calculator.feature
└── login.feature
# Run all Cucumber scenarios
mvn test
# Or with verify (includes any integration phase)
mvn verifyReports are generated in target/:
- HTML:
target/cucumber-reports.html - JSON:
target/cucumber.json
- Workflow:
.github/workflows/ci.yml - Triggers: Push and pull requests to
mainormaster - Steps: Checkout → JDK 17 →
mvn verify→ Upload Cucumber reports as artifacts
To use: push the repo to GitHub; the workflow runs automatically. Download cucumber-reports from the Actions run to view the HTML report.
- Calculator – Add, subtract, multiply with scenario outline.
- Login – Success and failure flows (in-memory demo, no real UI).
- Add more
.featurefiles undersrc/test/resources/com/example/bdd/. - Add step definition classes in
src/test/java/com/example/bdd/with the same package so the runner picks them up viaGLUE_PROPERTY_NAME.