Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ jobs:
build:
uses: reportportal/.github/.github/workflows/agent-java-ci.yml@main
with:
java-version: '17'
java-version: '21'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
release:
uses: reportportal/.github/.github/workflows/agent-java-release.yml@main
with:
java-version: '17'
java-version: '21'
secrets:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
16 changes: 10 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Changelog
### Changed
- Client version updated to [5.4.14](https://github.com/reportportal/client-java/releases/tag/5.4.14), by @HardNorth
- Karate dependency version updated to `1.5.2`, by @HardNorth
### Removed
- Java 11-16 support, by @HardNorth

## [Unreleased]
### Added
- Karate 2.x support, by @HardNorth
- Fancy HTTP logging, by @HardNorth
### Removed
- Java 17-20 support, by @HardNorth
- Karate 1.x support, by @HardNorth

## [5.4.0]
### Changed
- Client version updated to [5.4.13](https://github.com/reportportal/client-java/releases/tag/5.4.13), by @HardNorth
- Client version updated to [5.4.14](https://github.com/reportportal/client-java/releases/tag/5.4.14), by @HardNorth
- Karate dependency version updated to `1.5.2`, by @HardNorth
### Removed
- Java 11-16 support, by @HardNorth

## [5.3.7]
### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ test results in this case, the test project should use by `ReportPortalHook` cla
E.G.:

```java
import com.epam.reportportal.karate.ReportPortalHook;
import com.epam.reportportal.karate.ReportPortalResultListener;
import com.intuit.karate.Results;
import com.intuit.karate.Runner;
import org.junit.jupiter.api.Assertions;
Expand Down
35 changes: 20 additions & 15 deletions README_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ReportPortal runtime Hook for Karate tests
# ReportPortal Listeners for Karate tests

Karate reporters which uploads the results to a ReportPortal server.

Expand Down Expand Up @@ -98,29 +98,30 @@ dependencies {
### Runtime

Runtime publisher uploads Karate tests on ReportPortal during the test execution, providing real-time monitoring capabilities. To publish
test results in this case, the test project should use by `ReportPortalHook` class, an instance of which you should pass to Karate runner.
test results in this case, the test project should use `ReportPortalRunListener` class, an instance of which you should pass to Karate
runner.
E.G.:

```java
import com.epam.reportportal.karate.ReportPortalHook;
import com.intuit.karate.Results;
import com.intuit.karate.Runner;
import com.epam.reportportal.karate.ReportPortalRunListener;
import io.karatelabs.core.Runner;
import io.karatelabs.core.SuiteResult;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class ScenarioRunnerTest {
@Test
void testParallel() {
ReportPortalHook karateRuntimeHook = new ReportPortalHook(); // Initialize ReportPortal runtime Karate hook
Results results = Runner // Regular Karate runner
ReportPortalRunListener karateRuntimeListener = new ReportPortalRunListener(); // Initialize ReportPortal runtime Karate listener
SuiteResult results = Runner // Regular Karate runner
.path("classpath:features") // Path with feature files
.hook(karateRuntimeHook) // Add Karate hook
.listener(karateRuntimeListener) // Add Karate run listener
.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());
karateRuntimeListener.finishLaunch(); // Finish execution on ReportPortal
Assertions.assertEquals(0, results.getFeatureFailedCount(), "Non-zero fail count.\n Errors:\n" + results.getErrors());
}
}
```
Expand All @@ -129,25 +130,29 @@ class ScenarioRunnerTest {

Post-running publisher uploads Karate tests on ReportPortal after the test execution. It uses Karate result object to get data about tests.
It might be useful if your tests make heavy load both on ReportPortal server or on the running node. To publish test results in this case,
the test project should run by `KarateReportPortalRunner` instead of Karate runner.
the test project should add `ReportPortalResultListener` to Karate runner.
E.G.:

```java
import com.epam.reportportal.karate.KarateReportPortalRunner;
import com.intuit.karate.Results;
import com.epam.reportportal.karate.ReportPortalResultListener;
import io.karatelabs.core.Runner;
import io.karatelabs.core.SuiteResult;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class KarateRunnerTest {

@Test
public void testAll() {
Results results = KarateReportPortalRunner // Our runner with a Karate Publisher
ReportPortalResultListener resultListener = new ReportPortalResultListener(); // Initialize ReportPortal result listener
SuiteResult results = Runner // Regular Karate runner with ReportPortal result listener
.path("classpath:features") // Path with feature files
.resultListener(resultListener) // Add Karate result listener
.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());
resultListener.finishLaunch(); // Finish execution on ReportPortal
Assertions.assertEquals(0, results.getFeatureFailedCount(), "Non-zero fail count.\n Errors:\n" + results.getErrors());
}
}
```
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ project.ext.limits = [
'class' : 83
]

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
Expand All @@ -42,6 +42,7 @@ repositories {

dependencies {
api "com.epam.reportportal:client-java:${client_version}"
api 'com.epam.reportportal:utils-java-formatting:5.4.0'
compileOnly "io.karatelabs:karate-core:${karate_version}"
implementation "org.slf4j:slf4j-api:${slf4j_api_version}"
implementation "org.apache.commons:commons-lang3:3.19.0"
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name=agent-java-karate
version=5.4.1-SNAPSHOT
description=EPAM ReportPortal. Karate test framework [1.3.1, 1.5.2] adapter
version=5.5.0-SNAPSHOT
description=EPAM ReportPortal. Karate test framework [2.0.0, ) adapter
gradle_version=8.2
karate_version=1.5.2
karate_version=2.0.4
junit_version=5.10.1
mockito_version=5.4.0
test_utils_version=0.1.0
Expand Down

This file was deleted.

Loading
Loading