build.gradle.
Core Commands
Run All Tests
Execute all test scenarios in the project:The test task is configured with:
- JUnit Platform test engine
- UTF-8 encoding for test output
- System property forwarding from command line
- Automatic test logging (passed, skipped, failed events)
Generate Reports
Aggregate test results into Serenity HTML reports:This task:
- Processes test execution data from
target/site/serenity - Generates comprehensive HTML reports
- Creates living documentation from feature files
- Must run after test execution completes
Full Test Cycle
Run tests and generate reports in one command:This is the recommended workflow:
cleanremoves previous build artifactstestexecutes all test scenariosaggregategenerates fresh reports
The
test task is configured with finalizedBy(aggregate) in build.gradle, so running ./gradlew test automatically triggers report generation.Passing System Properties
The test task forwards all system properties from the command line. Use the-D flag to pass configuration:
Pre-configured Properties
The build.gradle sets default system properties:-D flags.
Tag Filtering
Filter which tests run using Cucumber tags through system properties:Clean Build
Remove all generated files and start fresh:build/directorytarget/directory- Compiled test classes
- Test execution data
- Previous reports
Gradle Options
Continue on Failure
The project is configured withgradle.startParameter.continueOnFailure = true, meaning test execution continues even when scenarios fail. This ensures:
- All tests run to completion
- Complete test coverage data is collected
- Full reports are generated
Show Standard Streams
Test output is visible in the console:- Real-time test progress
- System.out and System.err messages
- Test event summaries
Common Workflows
Development Testing
Development Testing
Quick test execution during development:Run only work-in-progress scenarios without generating full reports.
Smoke Testing
Smoke Testing
Execute critical path tests:Verify core functionality before full regression.
Full Regression
Full Regression
Complete test suite execution:Run all tests and generate comprehensive reports.
Environment-Specific Tests
Environment-Specific Tests
Target specific environment:Run integration tests against QA environment.
Troubleshooting
Build Fails to Start
Ensure the Gradle wrapper is executable:Java Version Issues
The project requires Java 21. Verify your Java version:Tests Not Running
Verify the test task configuration:- Feature files exist in
src/test/resources/features/ - Step definitions exist in
org.btg.practual.stepDefinitions - Tags match the filter in CucumberRunner or command line
Use
--info or --debug flags for detailed Gradle execution logs: