qase-tms / qase-java

Qase TMS Java SDK
https://developers.qase.io
Apache License 2.0
17 stars 5 forks source link

Test runs results are not publishing to Qase.io #105

Closed vrnsky closed 1 year ago

vrnsky commented 1 year ago

Hello!

Faced the following problem - Test Runs are not created when running unit/integration tests on the local machine

Preconditions:

  1. Java 17
  2. Spring Boot 3.x and above
  3. Junit 5
  4. Maven
  5. TestContainers

Followed the instructions described in the README.md:

  1. Added dependency
  2. Added a plugin to the build section
  3. Added the necessary variables for integration - specified in the instructions

When executing the command

clean test -U -DQASE_ENABLE=true -DQASE_PROJECT_CODE=PBD -DQASE_RUN_ID=4 -DQASE_API_TOKEN=my-junit5-token

The logs show the following:

2023-05-20 15:16:18,537 [main] INFO io.qase.api.QaseClient - Qase project code - PBD
2023-05-20 15:16:18,538 [main] INFO io.qase.api.QaseClient - Qase run id - 4

The test case ID in the Java code and in the API is the same

  @Qase(testId = 2)
  @DisplayName(value = "Test Case ")
  void testFormatPhone() {
    PhoneMapper phoneMapper = new PhoneMapper();
    Assertions.assertEquals("909XXXXXXX", phoneMapper.format("+7(909)XXX-XX-XX")); // Full phone number is hidden for security and privacy reason
  }

Response from REST API Qase.io (https://api.qase.io/v1/case/PBD)

{
   status: true
   "result": {
     "total": 1,
     "filtered": 1,
     "count": 1,
     "entities": [
       {
         "id": 2,
         position: 1
         "title": "Test case: mobile number formatting",
         "description": "Checks mobile phone number formatting",
         "preconditions": null
         postconditions: null
         "severity": 4,
         priority: 2
         type: 8
         layer: 3
         "is_flaky": 0,
         "behavior": 1,
         automation: 2
         status: 0
         "milestone_id": null,
         "suite_id": null
         "links": [],
         "custom_fields": [],
         attachments: [],
         steps_type: null
         steps: [],
         "params": [],
         "member_id": 1,
         "author_id": 146737,
         "tags": [],
         "deleted": null
         "created": "2023-05-20T06:14:34.000000Z",
         "updated": "2023-05-20T06:14:34.000000Z",
         "created_at": "2023-05-20T06:14:34+00:00",
         "updated_at": "2023-05-20T06:14:34+00:00"
       }
     ]
   }
}
savkk commented 1 year ago

Could you enable reporter debug mode? Add the next line to before-method : QaseClient.getApiClient().setDebugging(true);

It should give more information about errors.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.