Test repository with test case is created and executed in Cucumber Framework.
- Clone repository "test-parent-pom" (mandatory)
git clone git@github.com:ndviet/test-parent-pom.git- Clone this test repository to the same directory
git clone git@github.com:ndviet/test-cucumber-framework.git- Build source code in each repository following the order
- test-parent-pom
- test-cucumber-framework
- Run test cases in test repository
cd test-cucumber-frameworkmvn clean verify -DskipTests=false -D"includes=@SearchFlights" -D"selenium.browser.type=chrome"Use ndviet/test-automation-java-common as test runner container and start Selenium Grid from Docker Compose:
./test-cucumber-framework/run-in-container.shNo local build of test-parent-pom or test-automation-fwk is required.
Dependencies are resolved from GitHub Maven repositories.
If package access is private, configure GitHub Packages credentials in ~/.m2/settings.xml.
<settings>
<servers>
<server>
<id>github</id>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
</settings>Override tags, browser, or image when needed:
CUCUMBER_TAGS=@PromotionalCode BROWSER=chrome TEST_IMAGE=ndviet/test-automation-java-common:latest ./test-cucumber-framework/run-in-container.shKeep Grid containers running after test execution:
KEEP_GRID_UP=true ./test-cucumber-framework/run-in-container.shExecution mode defaults:
MAVEN_OFFLINE=true: run immediately using dependencies pre-seeded intest-automation-java-common.MAVEN_NO_SNAPSHOT_UPDATES=true: skip snapshot metadata checks (-nsu).MAVEN_AUTO_FALLBACK_ONLINE=true: if offline fails, retry online automatically.
If you need to force remote Maven resolution:
MAVEN_OFFLINE=false MAVEN_NO_SNAPSHOT_UPDATES=false ./test-cucumber-framework/run-in-container.shWorkflow file:
.github/workflows/cucumber-ui-container.yml
The workflow:
- Pulls shared test image
ndviet/test-automation-java-common(orDOCKERHUB_JAVA_COMMON_IMAGErepo variable). - Starts Selenium Grid containers.
- Runs Cucumber UI tests remotely against
http://selenium:4444. - Uploads
target/reportsandtarget/surefire-reportsas artifacts.
A sample project with entire repositories together for the test execution.