Forum Discussion

AlexGnu's avatar
AlexGnu
Occasional Visitor
2 years ago

Junit5 + Zephyr Scale + Gradle project integration

Hey,

My project: Gradle 7.6. + Java 11 + JUnit 5.9.2 + Selenium. Our UI test are run using Jenkins.
Goal: To send tests results to Zephyr Scale (integrated to our corporate Jira)


1) First of all, I tried to follow this instruction (https://github.com/SmartBear/zephyr-scale-junit-example) >  I am getting the following error: 

{"errorCode":400,"message":"Couldn't find any mapped test cases","status":"Bad Request"}

 while the build is Successful, which mean that test results are created. Each test use recommended by you naming approach (key + testCaseName), for example: 

OR_T48_createNewProduct

As this did not work for me, I tried the 2nd approach (to generate JSON, instead of xml) :
2) Therefore, I decided to follow another your instruction (https://support.smartbear.com/zephyr-scale-server/docs/test-automation/integrations/junit.html?_ga=2.102739970.2034120911.1679307013-224804660.1673353040)

Few questions here:
 2.1. How to register Zephyr Scale JUnit Listener in Gradle project?  Because, you showed only Maven example.
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.0</version>
            <configuration>
                <properties>
                    <property>
                        <name>listener</name>
                        <value>com.adaptavist.tm4j.junit.ExecutionListener</value>
                    </property>
                </properties>
            </configuration>
        </plugin>
    </plugins>
</build>


2.2. What is the expected location of test_result.json files in Gradle project?

Really need your help, thanks!