bld Extension for Running Tests with TestNG https://github.com/rife2/bld-testng
Find a file
2024-02-26 12:09:41 -08:00
.github/workflows Added GitHub workflow 2023-08-14 19:48:31 -07:00
.idea Bumped to bld 1.9.0 2024-02-26 12:09:41 -08:00
.vscode Bumped to bld 1.9.0 2024-02-26 12:09:41 -08:00
config Initial commit 2023-08-14 18:20:05 -07:00
examples Bumped to bld 1.9.0 2024-02-26 12:09:41 -08:00
lib/bld Bumped to bld 1.9.0 2024-02-26 12:09:41 -08:00
src Bumped to bld 1.9.0 2024-02-26 12:09:41 -08:00
.gitignore Added report location to log 2023-08-14 20:16:09 -07:00
bld Initial commit 2023-08-14 18:20:05 -07:00
bld.bat Initial commit 2023-08-14 18:20:05 -07:00
checkcliargs.sh Added shell script to check for new TestNg arguments 2024-01-28 17:54:29 -08:00
LICENSE.txt Added licence, copyright and README 2023-08-14 19:48:07 -07:00
README.md Bumped to bld 1.9.0 2024-02-26 12:09:41 -08:00

bld Extension to Run Tests with TestNG

License Java bld Release Snapshot GitHub CI

To install, please refer to the extensions documentation.

To run the tests with TestNG, add the following to your build file:

@BuildCommand(summary = "Tests the project with TestNG")
public void testng() throws Exception {
    new TestNgOperation()
    .fromProject(this)
    .packages("com.example")
    .execute();
}
./bld compile testng

You could also override the default test command:

@BuildCommand(summary = "Tests the project with TestNG")
public void test throws Exception {
    new TestNgOperation()
    .fromProject(this)
    .suites("src/test/resources/testng.xml")
    .verbose(2)
    .execute();
}
./bld compile test

Please check the TestNgOperation documentation for all available configuration options.

TestNG Dependency

Don't forget to add a TestNG test dependency to your build file, as it is not provided by the extension. For example:

repositories = List.of(MAVEN_CENTRAL);
scope(test).include(dependency("org.testng", "testng", version(7, 9, 0)));