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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'

- name: Cache Maven dependencies
Expand All @@ -32,7 +32,7 @@ jobs:
echo "This ensures all internal dependencies are available locally before testing"

# Module build order (based on dependencies)
MODULES=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "testomat-allure-adapter")
MODULES=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "java-reporter-karate2" "testomat-allure-adapter")

for module in "${MODULES[@]}"; do
if [ -d "$module" ]; then
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
run: |
echo "🧪 Running tests for all modules..."

MODULES=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "testomat-allure-adapter")
MODULES=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "java-reporter-karate2" "testomat-allure-adapter")

for module in "${MODULES[@]}"; do
if [ -d "$module" ]; then
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Validate project structure
run: |
set -e
REQUIRED_DIRS=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "testomat-allure-adapter")
REQUIRED_DIRS=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "java-reporter-karate2" "testomat-allure-adapter")
for dir in "${REQUIRED_DIRS[@]}"; do
if [[ ! -d "$dir" ]] || [[ ! -f "$dir/pom.xml" ]]; then
echo "❌ Missing: $dir"
Expand All @@ -52,10 +52,10 @@ jobs:
fi
echo "✅ Secrets OK"

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'

# Maven 3.10 (shipped in ubuntu-latest since Oct 2026) is incompatible with
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
echo "🔄 Setting version $VERSION in all modules individually..."

# List of all modules (each has its own pom.xml)
MODULES=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "testomat-allure-adapter")
MODULES=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "java-reporter-karate2" "testomat-allure-adapter")

for module in "${MODULES[@]}"; do
if [[ -d "$module" && -f "$module/pom.xml" ]]; then
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
echo "🔄 Updating internal dependencies to version $VERSION..."

# Only modules that have internal dependencies (excluding Core)
MODULES_WITH_DEPS=("java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "testomat-allure-adapter")
MODULES_WITH_DEPS=("java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "java-reporter-karate2" "testomat-allure-adapter")

for module in "${MODULES_WITH_DEPS[@]}"; do
if [[ -d "$module" && -f "$module/pom.xml" ]]; then
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
VERSION=${{ steps.version.outputs.version }}
echo "🔍 Verifying all module versions are set to $VERSION..."

MODULES=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "testomat-allure-adapter")
MODULES=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "java-reporter-karate2" "testomat-allure-adapter")
FAILED_MODULES=()

for module in "${MODULES[@]}"; do
Expand Down Expand Up @@ -356,6 +356,8 @@ jobs:
CUCUMBER_PID=$!
deploy_framework_module "java-reporter-karate" &
KARATE_PID=$!
deploy_framework_module "java-reporter-karate2" &
KARATE2_PID=$!
deploy_framework_module "testomat-allure-adapter" &
TAADAPTER_PID=$!

Expand Down Expand Up @@ -392,6 +394,13 @@ jobs:
else
echo "✅ Karate deployed"
fi

if ! wait $KARATE2_PID; then
FAILED_MODULES+=("karate2")
cat /tmp/deploy_logs/java-reporter-karate2.log
else
echo "✅ Karate 2 deployed"
fi

if ! wait $TAADAPTER_PID; then
FAILED_MODULES+=("taadapter")
Expand Down Expand Up @@ -420,7 +429,7 @@ jobs:
VERSION=${{ steps.version.outputs.version }}
GROUP_PATH=$(echo "${{ env.GROUP_ID }}" | tr '.' '/')

modules=("java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "testomat-allure-adapter")
modules=("java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "java-reporter-karate2" "testomat-allure-adapter")
echo "⏳ Waiting for Framework modules availability..."

WAIT_ITERATIONS=$((MAVEN_CENTRAL_WAIT_TIMEOUT / 120 / 3))
Expand Down Expand Up @@ -457,7 +466,7 @@ jobs:
run: |
set -e
VERSION=${{ steps.version.outputs.version }}
modules=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "testomat-allure-adapter")
modules=("java-reporter-core" "java-reporter-junit" "java-reporter-testng" "java-reporter-cucumber" "java-reporter-karate" "java-reporter-karate2" "testomat-allure-adapter")

echo "🔍 Verifying deployment..."
echo "Waiting 5 minutes for Maven Central propagation..."
Expand Down
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Run tests with JUnit, TestNG, Cucumber, Karate and automatically publish results
| TestNG | 7.x | 11+ |
| Cucumber | 7.x | 11+ |
| Karate | 1.x | 17+ |
| Karate 2 | 2.x | 21+ |

---

Expand Down Expand Up @@ -72,6 +73,16 @@ Add the Testomat reporter dependency that matches your test framework. Detailed
<version><LATEST_STABLE_VERSION></version>
</dependency>
```

### Karate 2

```xml
<dependency>
<groupId>io.testomat</groupId>
<artifactId>java-reporter-karate2</artifactId>
<version><LATEST_STABLE_VERSION></version>
</dependency>
```
Choose only one dependency corresponding to your test framework.

After adding the dependency continue with the framework-specific setup instructions below.
Expand Down Expand Up @@ -154,6 +165,14 @@ Register the hook factory:
.hookFactory(KarateHookFactory.create())
```

### Karate 2

Register the listener factory:

```java
.listenerFactory(KarateHookFactory.create())
```

---

## Test Code Synchronization
Expand Down Expand Up @@ -726,6 +745,9 @@ To enable named placeholders add to `pom.xml`:
* def step = stepMarker.mark
```
After this step() can be used as a regular Karate function.

> **Karate 2:** use the `io.testomat.karate2.marker.StepMarker` class instead.

#### Usage without a title
```gherkin
* step()
Expand Down Expand Up @@ -1090,6 +1112,21 @@ with the fully qualified name of your implementation:
.parallel(4);
```

### Karate 2

Karate 2 uses the event-based `RunListener` API instead of `RuntimeHook`.

1. Create your custom listener that implements `io.karatelabs.core.RunListener`
2. Register it (and the Testomat listener) via `listenerFactory`

```java
Runner.path("classpath:karateTests")
.listenerFactory(KarateHookFactory.create(MyListener::new))
.outputCucumberJson(true)
.outputJunitXml(true)
.parallel(4);
```

---

## Testomat Allure Adapter
Expand Down
2 changes: 1 addition & 1 deletion java-reporter-core/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>io.testomat</groupId>
<artifactId>java-reporter-core</artifactId>
<name>Testomat.io Reporter Core</name>
<version>0.18.2</version>
<version>0.20.0</version>
<description>Core functionality for Testomat.io Java test reporting library</description>
<url>https://github.com/testomatio/java-reporter</url>
<developers>
Expand Down
2 changes: 1 addition & 1 deletion java-reporter-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>io.testomat</groupId>
<artifactId>java-reporter-core</artifactId>
<version>0.19.3</version>
<version>0.20.0</version>
<packaging>jar</packaging>

<name>Testomat.io Reporter Core</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.testomat.core.constants;

public class CommonConstants {
public static final String REPORTER_VERSION = "0.19.3";
public static final String REPORTER_VERSION = "0.20.0";

public static final String TESTS_STRING = "tests";
public static final String API_KEY_STRING = "api_key";
Expand Down
2 changes: 1 addition & 1 deletion java-reporter-cucumber/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>io.testomat</groupId>
<artifactId>java-reporter-core</artifactId>
<version>0.19.3</version>
<version>0.20.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
2 changes: 1 addition & 1 deletion java-reporter-junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>io.testomat</groupId>
<artifactId>java-reporter-core</artifactId>
<version>0.19.3</version>
<version>0.20.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
2 changes: 1 addition & 1 deletion java-reporter-karate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>io.testomat</groupId>
<artifactId>java-reporter-core</artifactId>
<version>0.19.3</version>
<version>0.20.0</version>
</dependency>
<dependency>
<groupId>io.karatelabs</groupId>
Expand Down
Loading
Loading