Test repository with test case is created and executed in TestNG Framework.
git clone git@github.com:ndviet/test-parent-pom.git
git clone git@github.com:ndviet/test-testng-framework.git
cd test-testng-framework
mvn test -DskipTests=false -Dincludes="EasyUpload_io.xml"
mvn test -DskipTests=false -Dincludes="OnlyTestingBlog.xml"
mvn test -DskipTests=false -Dincludes="DemoQA_Download.xml"
Noted:
Use ndviet/test-automation-java-common as test runner container and start Selenium Grid from Docker Compose:
./test-testng-framework/run-in-container.sh
No 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 suite, browser, or image:
TESTNG_SUITE=DemoQA_Download.xml BROWSER=chrome TEST_IMAGE=ndviet/test-automation-java-common:latest ./test-testng-framework/run-in-container.sh
Keep Grid containers running after test execution:
KEEP_GRID_UP=true ./test-testng-framework/run-in-container.sh
Execution mode defaults:
MAVEN_OFFLINE=true: run immediately using dependencies pre-seeded in test-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-testng-framework/run-in-container.sh
Workflow file:
.github/workflows/testng-ui-container.yml
The workflow:
ndviet/test-automation-java-common (or DOCKERHUB_JAVA_COMMON_IMAGE repo variable).http://selenium:4444.target/reports and target/surefire-reports as artifacts.A sample project with entire repositories together for the test execution.