Skip to content
Open
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
23 changes: 16 additions & 7 deletions java-reporter-junit/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Java reporter integration with JUnit5
# Java reporter integration with JUnit

## Overview

Expand All @@ -14,7 +14,7 @@ This simple demo shows how Testomat.io Java reporter works in your project.
git clone https://github.com/testomatio/examples.git
```
2. Change the directory

```sh
cd java-reporter-junit
```
Expand All @@ -27,9 +27,11 @@ This simple demo shows how Testomat.io Java reporter works in your project.

## Configurations

**By default, the library runs with properties default values except `testomatio.api.key` and `testomatio.listening`**
**By default, the library runs with properties default values except `testomatio`**
`testomatio` is the api key of the particular project on the [Testomat.io](https://app.testomat.io) platform.
The reporting will be enabled automatically if the api key is provided.
(you can also provide the key as JVM property `-Dtestomatio` or environment variable TESTOMATIO)

![properties image](img/properties.png)

Add your project API key to the `testomatio.properties` file ad `testomatio.api.key`

Expand All @@ -44,8 +46,15 @@ Run tests with
where `tstmt_key` is your Testomat.io key from a particular project.

As a result, you will see a run report in your Project tab -> Runs on Testomat.io.
![run-result-img](img/runReport.png)

As you can see, there is the `testomatio.artifact.disable=1` line in the `testomatio.properties` file.
It disables the artifact handling by the reporter. Remove the value to enable or change it to "0".
But for the reporter to handle the artifacts, you must add values to S3 related properties in the `testomatio.properties`
file or provide them as JVM properties or ENV variables.
But the most convenient way is to set these values on the [Testomat.io](https://beta.testomat.io) platform:
![artifact-settings-img](img/artifact_settings_ui.png)

<div align="center">
<img src="img/runReport.png" alt="demo report result png" style="max-width: 70%; max-height: 420px;">
</div>
After all that done remove value from `testomatio.artifact.disable` or remove it completely and run test including WebDriverArtifactTest class.
![artifact run result img](img/artifact_run_result.png)

Binary file added java-reporter-junit/img/artifact_run_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added java-reporter-junit/img/artifact_settings_ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 37 additions & 4 deletions java-reporter-junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.9.2</junit.version>

<maven.surefire.version>3.0.0-M9</maven.surefire.version>
<aspectj.version>1.9.24</aspectj.version>
</properties>

<dependencies>
<dependency>
<groupId>io.testomat</groupId>
<artifactId>java-reporter-junit</artifactId>
<version>0.7.2</version>
<version>0.8.14</version>
</dependency>

<dependency>
Expand All @@ -35,21 +36,53 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.15.0</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.6.2</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>11</source>
<target>11</target>
<parameters>true</parameters>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<version>${maven.surefire.version}</version>
<configuration>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<includes>
<include>**/*Test.java</include>
</includes>
<parallel>methods</parallel>
<threadCount>4</threadCount>
<properties>
<configurationParameters>
junit.jupiter.execution.parallel.enabled=true
junit.jupiter.execution.parallel.mode.default=concurrent
</configurationParameters>
</properties>
</configuration>
</plugin>
</plugins>
</build>

</project>
15 changes: 9 additions & 6 deletions java-reporter-junit/src/main/resources/testomatio.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#Change to https://beta.testomat.io/ if you use it
testomatio.url=https://app.testomat.io/

#define the run title, or it will be default_run_title
testomatio.run.title=junit-example-run

#Particular project api key, starts with "tstmt_"
testomatio.api.key=
testomatio=

#Artifact related properties
testomatio.artifact.disable=1

#enables/disables the reporting (remove value to disable)
testomatio.listening=true
#S3 related properties
s3.bucket=
s3region=
s3.access-key-id=
s3.secret.access-key-id=
57 changes: 57 additions & 0 deletions java-reporter-testng/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
allure-results/

.claude
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

**/logs/
**/log/
*.jar

**/testomatio.properties

### IntelliJ IDEA ###
**/.idea/
.idea
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
19 changes: 14 additions & 5 deletions java-reporter-testng/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ This simple demo shows how Testomat.io Java reporter works in your project.

## Configurations

**By default, the library runs with properties default values except `testomatio.api.key` and `testomatio.listening`**
**By default, the library runs with properties default values except `testomatio`**
`testomatio` is the api key of the particular project on the [Testomat.io](https://app.testomat.io) platform.
The reporting will be enabled automatically if the api key is provided.
(you can also provide the key as JVM property `-Dtestomatio` or environment variable TESTOMATIO)

![properties img](img/properties.png)

Add your project API key to the `testomatio.properties` file ad `testomatio.api.key`

Expand All @@ -44,8 +46,15 @@ Run tests with
where `tstmt_key` is your Testomat.io key from a particular project.

As a result, you will see a run report in your Project tab -> Runs on Testomat.io.
![run-result-img](img/runReport.png)

<div align="center">
<img src="img/runReport.png" alt="demo report result png" style="max-width: 70%; max-height: 420px;">
</div>
As you can see, there is the `testomatio.artifact.disable=1` line in the `testomatio.properties` file.
It disables the artifact handling by the reporter. Remove the value to enable or change it to "0".
But for the reporter to handle the artifacts, you must add values to S3 related properties in the `testomatio.properties`
file or provide them as JVM properties or ENV variables.
But the most convenient way is to set these values on the [Testomat.io](https://beta.testomat.io) platform:
![artifact-settings-img](img/artifact_settings_ui.png)

After all that done remove value from `testomatio.artifact.disable` or remove it completely and run test including WebDriverArtifactTest class.
![artifact run result img](img/artifact_run_result.png)

Binary file added java-reporter-testng/img/artifact_run_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added java-reporter-testng/img/artifact_settings_ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 36 additions & 1 deletion java-reporter-testng/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,67 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<testng.version>7.7.1</testng.version>
<maven.surefire.version>3.0.0-M9</maven.surefire.version>
<maven.surefire.version>3.0.0-M9</maven.surefire.version>
<aspectj.version>1.9.24</aspectj.version>
</properties>

<dependencies>
<dependency>
<groupId>io.testomat</groupId>
<artifactId>java-reporter-testng</artifactId>
<version>0.7.2</version>
<version>0.8.14</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.15.0</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.6.2</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>11</source>
<target>11</target>
<parameters>true</parameters>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<includes>
<include>**/*Test.java</include>
</includes>
<parallel>methods</parallel>
<threadCount>4</threadCount>
<properties>
<configurationParameters>
junit.jupiter.execution.parallel.enabled=true
junit.jupiter.execution.parallel.mode.default=concurrent
</configurationParameters>
</properties>
</configuration>
</plugin>
</plugins>
Expand Down
11 changes: 0 additions & 11 deletions java-reporter-testng/src/main/resources/testomatio.properties

This file was deleted.

Loading
Loading