@@ -103,17 +103,24 @@ E.G.:
103103
104104``` java
105105import com.epam.reportportal.karate.ReportPortalHook ;
106+ import com.intuit.karate.Results ;
106107import com.intuit.karate.Runner ;
108+ import org.junit.jupiter.api.Assertions ;
109+ import org.junit.jupiter.api.Test ;
107110
108111class ScenarioRunnerTest {
109112 @Test
110113 void testParallel () {
111- return Runner
112- .path(" classpath:examples" )
113- .hook(new ReportPortalHook ())
114- .outputCucumberJson(true )
115- .tags(" ~@ignore" )
116- .parallel(1 );
114+ ReportPortalHook karateRuntimeHook = new ReportPortalHook (); // Initialize ReportPortal runtime Karate hook
115+ Results results = Runner // Regular Karate runner
116+ .path(" classpath:features" ) // Path with feature files
117+ .hook(karateRuntimeHook) // Add Karate hook
118+ .outputCucumberJson(true ) // Generate cucumber report
119+ .tags(" ~@ignore" ) // Ignore tests marked with the tag
120+ .parallel(2 ); // Run in 2 Threads
121+ // Here you can additionally run tests, retries, etc.
122+ karateRuntimeHook. finishLaunch(); // Finish execution on ReportPortal
123+ Assertions . assertEquals(0 , results. getFailCount(), " Non-zero fail count.\n Errors:\n " + results. getErrorMessages());
117124 }
118125}
119126```
@@ -127,15 +134,20 @@ E.G.:
127134
128135``` java
129136import com.epam.reportportal.karate.KarateReportPortalRunner ;
137+ import com.intuit.karate.Results ;
138+ import org.junit.jupiter.api.Assertions ;
139+ import org.junit.jupiter.api.Test ;
140+
141+ public class KarateRunnerTest {
130142
131- class ScenarioRunnerTest {
132143 @Test
133- void testParallel () {
134- KarateReportPortalRunner
135- .path(" classpath:examples" )
136- .outputCucumberJson(true )
137- .tags(" ~@ignore" )
138- .parallel(1 );
144+ public void testAll () {
145+ Results results = KarateReportPortalRunner // Our runner with a Karate Publisher
146+ .path(" classpath:features" ) // Path with feature files
147+ .outputCucumberJson(true ) // Generate cucumber report
148+ .tags(" ~@ignore" ) // Ignore tests marked with the tag
149+ .parallel(2 ); // Run in 2 Threads
150+ Assertions . assertEquals(0 , results. getFailCount(), " Non-zero fail count.\n Errors:\n " + results. getErrorMessages());
139151 }
140152}
141153```
0 commit comments