Skip to content

Commit 7cdbae8

Browse files
committed
Update Karate example
1 parent 21657ef commit 7cdbae8

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed
Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
1+
/*
2+
* Copyright 2025 EPAM Systems
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.epam.reportportal.example.karate;
218

3-
import com.epam.reportportal.karate.KarateReportPortalRunner;
19+
import com.epam.reportportal.karate.ReportPortalHook;
420
import com.intuit.karate.Results;
21+
import com.intuit.karate.Runner;
522
import org.junit.jupiter.api.Assertions;
623
import org.junit.jupiter.api.Test;
724

825
public class KarateRunnerTest {
926

1027
@Test
1128
public void testAll() {
12-
Results results = KarateReportPortalRunner // Our runner with a Karate Hook
29+
ReportPortalHook karateHook = new ReportPortalHook(); // Initialize ReportPortal runtime Karate hook
30+
Results results = Runner // Regular Karate runner
1331
.path("classpath:features") // Path with feature files
32+
.hook(karateHook) // Add Karate hook
1433
.outputCucumberJson(true) // Generate cucumber report
1534
.tags("~@ignore") // Ignore tests marked with the tag
1635
.parallel(2); // Run in 2 Threads
36+
// Here you can additionally run tests, retries, etc.
37+
karateHook.finishLaunch(); // Finish execution on ReportPortal
1738
Assertions.assertEquals(0, results.getFailCount(), "Non-zero fail count.\n Errors:\n" + results.getErrorMessages());
1839
}
1940
}

0 commit comments

Comments
 (0)