diff --git a/src/content/docs/test-insights/test-frameworks/junit.mdx b/src/content/docs/test-insights/test-frameworks/junit.mdx index 98f57e92db..66eba51726 100644 --- a/src/content/docs/test-insights/test-frameworks/junit.mdx +++ b/src/content/docs/test-insights/test-frameworks/junit.mdx @@ -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") - } } ``` diff --git a/src/content/docs/test-insights/test-frameworks/testng.mdx b/src/content/docs/test-insights/test-frameworks/testng.mdx index 21a33e3512..e59f26292d 100644 --- a/src/content/docs/test-insights/test-frameworks/testng.mdx +++ b/src/content/docs/test-insights/test-frameworks/testng.mdx @@ -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") - } } ``` @@ -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: