Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/content/docs/test-insights/test-frameworks/junit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,12 @@ The JUnit XML reports will be generated in `target/surefire-reports/`.

### Using Gradle

Configure the test task in your `build.gradle`:
Gradle's `test` task writes JUnit XML reports without any extra configuration.
If your tests run on JUnit 5, enable the platform in your `build.gradle`:

```groovy
test {
useJUnitPlatform()
reports {
junitXml.enabled = true
junitXml.destination = file("$buildDir/test-results/test")
}
}
```

Expand Down
9 changes: 4 additions & 5 deletions src/content/docs/test-insights/test-frameworks/testng.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,12 @@ mvn test

### Using Gradle

Configure the test task in your `build.gradle`:
Gradle's `test` task writes JUnit XML reports without any extra configuration.
Point the task at TestNG in your `build.gradle`:

```groovy
test {
useTestNG()
reports {
junitXml.enabled = true
junitXml.destination = file("$buildDir/test-results/test")
}
}
```

Expand All @@ -73,6 +70,8 @@ Run tests with:
./gradlew test
```

The JUnit XML reports will be generated in `build/test-results/test/`.

### Using TestNG Directly

You can also run TestNG directly with JUnit listener:
Expand Down