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

🐞: ITestListener of TestNG caused the Allure does not display test's steps at all, but custom ones only. #1150

Open
farious2009 opened this issue Feb 13, 2025 · 0 comments
Labels
triage type:bug Something isn't working

Comments

@farious2009
Copy link

What happened?

Hi Team,

I am not 100% sure whether it is a bug, but a behavior is rather weird anyway.

Class TestListener implements ITestListener {

    @Override
    public void onTestSuccess(ITestResult result) {
        if (method.isTestMethod() && method.getTestResult().isSuccess()) {
            throw new AssertionError("With ITestListener ");
        }
 }
 
 }

this test will be working strangely returning almost nothing within it:


    @Test
    public void dummyTest() {
        some test steps ();
        some test steps ();
        some test steps ();
        some test steps ();
    }

This is an example of such the report without body for some reason (except manually created step "Test..."):

Image

But when I implement the same method, this time using another TestNG listener as TestLifecycleListener, then all works as expected and visible with the body:

Class TestListener implements IInvokedMethodListener {

    public void afterInvocation(IInvokedMethod method, ITestResult testResult) {
            if (method.isTestMethod() && method.getTestResult().isSuccess()) {
                throw new AssertionError("With IInvokedMethodListener ");
            }
        }
 }

Image

Is it a bug or intended to be like this for some reason?

We do use for whole modules within a project:
Selenide + Maven + TestNG

<allure.version>2.27.0</allure.version>
<allure-maven.version>2.12.0</allure-maven.version>
<plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
                <version>${allure-maven.version}</version>
                <configuration>
                    <reportVersion>${allure.version}</reportVersion>
                </configuration>
            </plugin>

    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-selenide</artifactId>
        <version>${allure.version}</version>
    </dependency>

    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-testng</artifactId>
        <version>${allure.version}</version>
    </dependency>

    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-plugin-api</artifactId>
        <version>${allure.version}</version>
    </dependency>

### What Allure Integration are you using?

allure-testng

### What version of Allure Integration you are using?

2.27

### What version of Allure Report you are using?

2.27

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct
@farious2009 farious2009 added triage type:bug Something isn't working labels Feb 13, 2025
@farious2009 farious2009 changed the title 🐞: ITestListener of TestNG caused the Allure does not display test's steps at all. 🐞: ITestListener of TestNG caused the Allure does not display test's steps at all, but custom ones only. Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant