38 lines
1.9 KiB
Markdown
38 lines
1.9 KiB
Markdown
# [bld](https://rife2.com/bld) Extension to Run Tests with [TestNG](https://testng.org/)
|
|
|
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
[](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
|
|
[](https://rife2.com/bld)
|
|
[](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-testng)
|
|
[](https://repo.rife2.com/#/snapshots/com/uwyn/rife2/bld-testng)
|
|
[](https://github.com/rife2/bld-testng/actions/workflows/bld.yml)
|
|
|
|
To install, please refer to the [extensions documentation](https://github.com/rife2/bld/wiki/Extensions).
|
|
|
|
To run the tests with TestNG, add the following to your build file:
|
|
|
|
```java
|
|
@Override
|
|
public TestOperation<?, ?> testOperation() {
|
|
return new TestNgOperation()
|
|
.fromProject(this)
|
|
.packages("com.example");
|
|
}
|
|
```
|
|
|
|
```console
|
|
./bld compile test
|
|
```
|
|
|
|
- [View Examples Project](https://github.com/rife2/bld-testng/tree/master/examples)
|
|
|
|
Please check the [TestNgOperation documentation](https://rife2.github.io/bld-testng/rife/bld/extension/TestNgOperation.html#method-summary) 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:
|
|
|
|
```java
|
|
repositories = List.of(MAVEN_CENTRAL);
|
|
scope(test).include(dependency("org.testng", "testng", version(7, 11, 0)));
|
|
```
|