1

I have following TestNG xml file defined in Jenkins, that is to run same set of test cases against 2 different server, alpha and beta.

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="My Cron Job Test" verbose="2" parallel="tests" thread-count="2">
<test name="Alpha Test">
    <parameter name="serverURL" value="https://alpha/index.html" />
    <classes> ...</classes>
</test>
<test name="Beta Test">
    <parameter name="serverURL" value="https://beta/index.html/>
    <classes>...</classes>
</test>
</suite>

And I just start to use allure plug-in reports in jenkins. Question I have is, would Allure plug-in report be possible to give a clear summary as what test case fails on which server ?

1 Answer 1

2

It depends what you want. If you want a separate allure report for each server, you should run your tests in two different commands and generate allure report for each one, aka:

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.1</version>
        <configuration>
            <suiteXmlFiles>
                <file>src/test/resources/testng.xml</file>
            </suiteXmlFiles>
            <properties>
                <property>
                    <name>testnames</name>
                    <value>${selectedTests}</value>
                </property>
            </properties>
        </configuration>
    </plugin>
</plugins>

And then in terminal:

mvn clean test -DselectedTests=AlphaTest
allure generate
mvn clean test -DselectedTests=BetaTest
allure generate

That way you will get different allure report for each test. Another way, run the whole test suite and attach the environment server to each test for this kind of indication. More info here: https://docs.qameta.io/allure/#_attachments

Sign up to request clarification or add additional context in comments.

2 Comments

So if I understand correctly, the allure report is generated per each running. For one TestNG running session, there can only be one report.
That's right there is a Listener which interact with TestNG suite and write the results accordingly to the allure-results folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.