Skip to content

If classes with the same names are used in the tests run by TestNG, then only the last result will be recorded. #632

Description

@gearup66

Describe the bug
My project Selenide+TestNG+Allure+Maven
I use TуstNG suites, which have test classes with the same names.
The tests pass successfully, but the Allure report contains only a report on tests from the last TestSuite, for tests with the same class names.

To Reproduce
There are two test suite

<test name = "correspondentTest1">
    <classes>
        <class name = "ru.ga.TestSaeLogin" />
        <class name = "ru.ga.TestScriptAddCorrespondent" />
        <class name = "ru.ga.TestScriptChangeCorrespondent" />
        <class name = "ru.ga.TestScriptDeleteCorrespondent" />
        <class name = "ru.ga.TestSaeLogout" />
    </classes>
</test>
<test name = "correspondentTest2">
    <classes>
        <class name = "ru.ga.TestSaeLogin1" />
        <class name = "ru.ga.TestScriptAddCorrespondent" />
        <class name = "ru.ga.TestScriptChangeCorrespondent" />
        <class name = "ru.ga.TestScriptDeleteCorrespondent" />
        <class name = "ru.ga.TestSaeLogout1" />
    </classes>
</test>

In maven pom.xml

                       <suiteXmlFiles>
                            <suiteXmlFile>src/test/java/ru/ga/TestsSuite1.xml</suiteXmlFile>
                               <suiteXmlFile>src/test/java/ru/ga/TestsSuite2.xml</suiteXmlFile>
                        </suiteXmlFiles>

start test maven command

mvn clean test

result in maven

[INFO] Results:

[INFO]

[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 02:22 min

[INFO] Finished at: 2021-08-19T06:47:46+03:00

[INFO] -------

Tests run: 16 that

        <class name = "ru.ga.TestScriptAddCorrespondent" /> - parametrized for 2 runs
        <class name = "ru.ga.TestScriptChangeCorrespondent" /> - parametrized for 2 runs
        <class name = "ru.ga.TestScriptDeleteCorrespondent" /> - parametrized for 2 runs

In Allure report

see Screenshots

Expected behavior
test results with the same class names should not overwrite results

Screenshots
image001 (2)

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions