diff --git a/CHANGELOG.md b/CHANGELOG.md index 41a2a5a..23ea8c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Changed +- Client version updated to [5.4.6](https://github.com/reportportal/client-java/releases/tag/5.4.6), by @HardNorth ## [5.3.2] ### Changed diff --git a/README.md b/README.md index e26808d..dd9f226 100644 --- a/README.md +++ b/README.md @@ -103,17 +103,24 @@ E.G.: ```java import com.epam.reportportal.karate.ReportPortalHook; +import com.intuit.karate.Results; import com.intuit.karate.Runner; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; class ScenarioRunnerTest { @Test void testParallel() { - return Runner - .path("classpath:examples") - .hook(new ReportPortalHook()) - .outputCucumberJson(true) - .tags("~@ignore") - .parallel(1); + ReportPortalHook karateRuntimeHook = new ReportPortalHook(); // Initialize ReportPortal runtime Karate hook + Results results = Runner // Regular Karate runner + .path("classpath:features") // Path with feature files + .hook(karateRuntimeHook) // Add Karate hook + .outputCucumberJson(true) // Generate cucumber report + .tags("~@ignore") // Ignore tests marked with the tag + .parallel(2); // Run in 2 Threads + // Here you can additionally run tests, retries, etc. + karateRuntimeHook.finishLaunch(); // Finish execution on ReportPortal + Assertions.assertEquals(0, results.getFailCount(), "Non-zero fail count.\n Errors:\n" + results.getErrorMessages()); } } ``` @@ -127,15 +134,20 @@ E.G.: ```java import com.epam.reportportal.karate.KarateReportPortalRunner; +import com.intuit.karate.Results; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class KarateRunnerTest { -class ScenarioRunnerTest { @Test - void testParallel() { - KarateReportPortalRunner - .path("classpath:examples") - .outputCucumberJson(true) - .tags("~@ignore") - .parallel(1); + public void testAll() { + Results results = KarateReportPortalRunner // Our runner with a Karate Publisher + .path("classpath:features") // Path with feature files + .outputCucumberJson(true) // Generate cucumber report + .tags("~@ignore") // Ignore tests marked with the tag + .parallel(2); // Run in 2 Threads + Assertions.assertEquals(0, results.getFailCount(), "Non-zero fail count.\n Errors:\n" + results.getErrorMessages()); } } ``` diff --git a/README_TEMPLATE.md b/README_TEMPLATE.md index 40a15d9..13c4f66 100644 --- a/README_TEMPLATE.md +++ b/README_TEMPLATE.md @@ -103,17 +103,24 @@ E.G.: ```java import com.epam.reportportal.karate.ReportPortalHook; +import com.intuit.karate.Results; import com.intuit.karate.Runner; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; class ScenarioRunnerTest { @Test void testParallel() { - return Runner - .path("classpath:examples") - .hook(new ReportPortalHook()) - .outputCucumberJson(true) - .tags("~@ignore") - .parallel(1); + ReportPortalHook karateRuntimeHook = new ReportPortalHook(); // Initialize ReportPortal runtime Karate hook + Results results = Runner // Regular Karate runner + .path("classpath:features") // Path with feature files + .hook(karateRuntimeHook) // Add Karate hook + .outputCucumberJson(true) // Generate cucumber report + .tags("~@ignore") // Ignore tests marked with the tag + .parallel(2); // Run in 2 Threads + // Here you can additionally run tests, retries, etc. + karateRuntimeHook.finishLaunch(); // Finish execution on ReportPortal + Assertions.assertEquals(0, results.getFailCount(), "Non-zero fail count.\n Errors:\n" + results.getErrorMessages()); } } ``` @@ -127,15 +134,20 @@ E.G.: ```java import com.epam.reportportal.karate.KarateReportPortalRunner; +import com.intuit.karate.Results; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class KarateRunnerTest { -class ScenarioRunnerTest { @Test - void testParallel() { - KarateReportPortalRunner - .path("classpath:examples") - .outputCucumberJson(true) - .tags("~@ignore") - .parallel(1); + public void testAll() { + Results results = KarateReportPortalRunner // Our runner with a Karate Publisher + .path("classpath:features") // Path with feature files + .outputCucumberJson(true) // Generate cucumber report + .tags("~@ignore") // Ignore tests marked with the tag + .parallel(2); // Run in 2 Threads + Assertions.assertEquals(0, results.getFailCount(), "Non-zero fail count.\n Errors:\n" + results.getErrorMessages()); } } ``` diff --git a/build.gradle b/build.gradle index ff117ff..3394658 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,7 @@ dependencies { api "com.epam.reportportal:client-java:${client_version}" compileOnly "com.intuit.karate:karate-core:${karate_version}" implementation "org.slf4j:slf4j-api:${slf4j_api_version}" - implementation "org.apache.commons:commons-lang3:3.18.0" + implementation "org.apache.commons:commons-lang3:3.19.0" testImplementation "com.intuit.karate:karate-core:${karate_version}" testImplementation "com.epam.reportportal:logger-java-logback:${logger_version}" @@ -56,7 +56,7 @@ dependencies { testImplementation "org.mockito:mockito-junit-jupiter:${mockito_version}" testImplementation "org.hamcrest:hamcrest-core:${hamcrest_version}" testImplementation "com.squareup.okhttp3:okhttp:${okhttp_version}" - testImplementation "org.apache.commons:commons-lang3:3.18.0" + testImplementation "org.apache.commons:commons-lang3:3.19.0" } test { diff --git a/gradle.properties b/gradle.properties index 04e56b5..035b5b1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ karate_version=1.4.1 junit_version=5.10.1 mockito_version=5.4.0 test_utils_version=0.1.0 -client_version=5.4.4 +client_version=5.4.6 slf4j_api_version=2.0.7 logger_version=5.4.0 hamcrest_version=2.2