Skip to content

🐞: setStatus not updated status and stopStep destroys nesting of steps #1133

Open
@VaXoID55

Description

@VaXoID55

What happened?

Example Test:

public class MyTest {
    @Rule
    public Timeout globalTimeout = new Timeout(10, TimeUnit.MINUTES);

    @Test
    @DisplayName("ExampleTestName")
    public void MyTes_1() {
        simpleStep();
    }

    @Step("Inner step")
    private void innerStep(boolean result) {
        Utils.sleep(200);
        StepUtils.setStepStatus(result);
    }

    @Step("Outer step")
    public void simpleStep() {
        step("Simple step");
        step("Simple step with status", Status.FAILED);
        innerStep(true);
        innerStep(false);
        innerStep(true);
        innerStep(false);
    }
}

If use setStepStatus as:

public static boolean setStepStatus(boolean status) {
    if (!status) {
        Allure.getLifecycle().updateStep(result ->
                result.setStatus(Status.FAILED));
        Allure.getLifecycle().stopStep();
    }
    return status;
}

then all nested steps after FAILED cease to be nested, but status step set correctly:
image
If use setStepStatus as (without stopStep()):

public static boolean setStepStatus(boolean status) {
    if (!status) {
        Allure.getLifecycle().updateStep(result ->
                result.setStatus(Status.FAILED));
    }
    return status;
}

the nesting of steps is correct, but the status is not set to FILED
image

What Allure Integration are you using?

allure-junit4

What version of Allure Integration you are using?

2.29.0

What version of Allure Report you are using?

2.29.0

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions