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

Before Suite and AfterSuite steps not appearing in allure report after version 2.21 #1045

Open
1 task done
zanoon2020 opened this issue Dec 6, 2023 · 2 comments
Open
1 task done
Labels
triage type:bug Something isn't working

Comments

@zanoon2020
Copy link

Describe the Bug

after suite method not shown in allure report since version 2.22
for example below code

Steps to Reproduce

package allure;

import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.Test;

import io.qameta.allure.Attachment;
import io.qameta.allure.Step;

public class TestClass {

   @BeforeSuite
public void beforeSuite() {
	stepHasNestedSteps();
}

@BeforeMethod
public void beforeMethod() {
	stepHasNestedSteps();
}

@Step("step has nested steps")
public void stepHasNestedSteps() {
	callAttachment();
	callAttachment2();
}

@Attachment("attachment - nested ")
public void callAttachment() {
	System.out.println("attachment");
}

@Step("another nested step")
public void callAttachment2() {
	callAttachment();
}



@Test(description="description")
public void test() {
stepHasNestedSteps();
	
}


@AfterMethod(description ="after test")
public void after(){
	stepHasNestedSteps();
}


@AfterSuite(description ="after Suit")
public void afterSuit() {
	stepHasNestedSteps();
}

}

Expected Behaviour

before suit and after suit to appear in report

Screenshots or Additional Context

No response

What Language are you using?

Java

What Framework/Allure Integration you are using?

allure-testng

What version of Allure Integration you are using?

2.25.0

What version of Allure Report you are using?

2.25.0

Code of Conduct

  • I agree to follow this project's Code of Conduct
@zanoon2020 zanoon2020 added triage type:bug Something isn't working labels Dec 6, 2023
@AlexChernookov
Copy link

@zanoon2020 I encounter a similar problem with the @step annotation.
In case of using following code:

@Step("my step")
public void doSomething(){}

the record "my step" is not appearing in Allure report

but when I make

Allure.step("dummy step", ()->doSomething())

this record is appearing in Allure report as "dummy step"
I was debugging AllureLifecycle and when I'm using @step looks like method startStep is never called. But it works fine for static method step

In my case it's happed for
testng 7.5
allure 2.23.0

@zanoon2020
Copy link
Author

Thanks @AlexChernookov , actually my issue not with @ step, any idea how to do the same with @beforeSuit

@baev baev transferred this issue from allure-framework/allure2 May 9, 2024
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

2 participants