Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using JUnit reporter (still) generates the wrong name per test #3279

Open
SamLimpic opened this issue Aug 26, 2024 · 0 comments
Open

Using JUnit reporter (still) generates the wrong name per test #3279

SamLimpic opened this issue Aug 26, 2024 · 0 comments

Comments

@SamLimpic
Copy link

SamLimpic commented Aug 26, 2024

In response to Fix JUnit reporter classname: this does not resolve the issue introduced in 3231, in response to Issue 3230

For instance this file contains 2 nested test directories:

{
  "info": {
    "_postman_id": "123",
    "name": "Unique Collection"
  },
  "item": [
    {
      "name": "Positive Test Cases",
      "item": [
        {
          "name": "Features",
          "item": [
            {
              "name": "Request",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "pm.test(`Testing unique Feature`, () => {});"
                    ]
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "Negative Test Cases",
      "item": [
        {
          "name": "Validations",
          "item": [
            {
              "name": "Request",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "pm.test(`Testing unique Validation`, () => {});"
                    ]
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

This single Unique Collection contains 2 tests, following this directory hierarchy:

PositiveTestCases > Features > Request --> "Testing unique Feature"
NegativeTestCases > Validations > Request --> "Testing unique Validation"

I would expect the JUnit report to output these tests on the report, as well as the collection the tests came from:

UniqueCollection.Testing unique Feature
UniqueCollection.Testing unique Validation

Instead, I get this:

PositiveTestCasesFeaturesRequest.Testing unique Feature
NegativeTestCasesValidationsRequest.Testing unique Validation

When multiple collections are run, they no longer display their respective Collection in the runner
Instead they list a series of directories without separation or punctuation, ending with the name of the failing request & test

This is much less helpful from a diagnostic perspective, where dozens of results for multiple collections are displayed simultaneously, with no additional indication of where each individual failure came from

PositiveTestCasesFeaturesRequest.Testing unique Feature
NegativeTestCasesValidationsRequest.Testing unique Validation
PositiveTestCasesFeaturesRequest.Testing unique Feature
NegativeTestCasesValidationsRequest.Testing unique Validation
PositiveTestCasesFeaturesRequest.Testing unique Feature
NegativeTestCasesValidationsRequest.Testing unique Validation
PositiveTestCasesFeaturesRequest.Testing unique Feature
NegativeTestCasesValidationsRequest.Testing unique Validation

vs

UnitTests.Testing unique Feature
UnitTests.Testing unique Validation
IntegrationTests.Testing unique Feature
IntegrationTests.Testing unique Validation
RegressionTests.Testing unique Feature
RegressionTests.Testing unique Validation
AcceptanceTests.Testing unique Feature
AcceptanceTests.Testing unique Validation

I would guess that this is the updated attribs.name.value displayed in place of the original formatted collection.name, but the impact of this change seems to be farther reaching than intended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@SamLimpic and others