Skip to content

rife2/bld-testng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

166 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bld Extension to Run Tests with TestNG

License Java bld Release Snapshot GitHub CI

To install the latest version, add the following to the lib/bld/bld-wrapper.properties file:

bld.extension-testng=com.uwyn.rife2:bld-testng

For more information, please refer to the extensions documentation.

Test with TestNG

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

@Override
public void test() throws Exception {
    new TestNgOperation()
            .fromProject(this)
            .packages("com.example")
            .execute();
}

or if using BaseProject:

@Override
public TestOperation<?, ?> testOperation() {
    return new TestNgOperation()
            .fromProject(this)
            .packages("com.example");
}

To run tests:

./bld compile test

./bld compile test -testclass=com.example.Test,com.sample.Test
./bld compile test -methods=com.example.Test.foo,com.example.Test.bar
./bld compile test -testnames=Test1,Test2
./bld compile test -groups=group1,group2
./bld compile test -excludegroups=group1,group3
./bld compile test -log=5

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, 12, 0)));

Packages

 
 
 

Languages