Allure .step and .attach is causing screenshots to link at end of the report while annotation step is adding screenshot below the step #2545
-
Describe the BugAllure .step and .attach is causing screenshots to link at end of the report while annotation step is adding screenshot below the step Steps to ReproduceIn java:
Expected BehaviourEvery screenshot should attach under its respective step Screenshots or Additional Contextworking only in annotations mode as expected when used @step What Language are you using?Java What Framework/Allure Integration you are using?allure-testng What version of Allure Integration you are using?2.26.0 What version of Allure Report you are using?2.26.0 Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Answered by
baev
May 8, 2024
Replies: 1 comment
-
You can use the attachments meta steps feature. Wrap each attachment method with a lambda step, and make sure the step name is the same as the attachment. Allure.step("screenshot", () => {
Allure.addAttachment(
"screenshot",
new ByteArrayInputStream(((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES))
);
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
baev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the attachments meta steps feature. Wrap each attachment method with a lambda step, and make sure the step name is the same as the attachment.