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

Test case is not getting aborted if any step in the scenario got failed #3490

Open
SrivaniChennupati opened this issue Jun 26, 2024 · 0 comments

Comments

@SrivaniChennupati
Copy link

SrivaniChennupati commented Jun 26, 2024

I wanted to abort the test case if any step got failed , But as per the serenity behavior its executing the subsequent steps in dry run mode but I want to have a control over it , so used "deep.step.execution.after.failures=false" at serenity.properties file level which is not helpful @wakaleo : Could you please look into this ?

The below is the logic we implemented at BaseStepListener class level:
@OverRide
public void stepFailed(StepFailure failure) {

	Log.error("Step failed: " + failure.getDescription());

	if (failure.getException() != null) {
		// Step failed due to an error, mark the current test as failed and stop further
		StepEventBus.getEventBus().testFailed(failure.getException());		
	}
	
	}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant