allure-java
allure-java copied to clipboard
Ability to choose the position of attachments
Problem With a large number of nested steps, it is difficult to understand which step the attachment belongs to.
In this case, it is difficult for me to understand which step the lower attachment belongs to, Step 1 or Step 2.
Java code:
public class ExampleTest {
@Test
void test() {
Allure.step("Step 1", () -> {
Allure.addAttachment("Step description", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.");
Allure.step("Step 2", () -> {
Allure.step("Step 3", () -> {
Allure.addAttachment("Step description", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.");
Allure.step("Step 4", () -> {
});
});
});
});
}
}
Report:

Solution Need the ability to choose the position of the attachment, on top or bottom. Probably make the "top" option the default.
Then the attachments will move in the report like this:

In code it might look like this:
Allure.step("Step 1", () -> {
Allure.addAttachment("Step description", AttachmentPosition.ON_TOP, ".........");
});