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

A failed step screenshot is not attached to the report #3555

Open
ak270296 opened this issue Oct 9, 2024 · 3 comments
Open

A failed step screenshot is not attached to the report #3555

ak270296 opened this issue Oct 9, 2024 · 3 comments

Comments

@ak270296
Copy link

ak270296 commented Oct 9, 2024

What happened?

I want to attach a screenshot to the report after each step fails but only the screenshot for the first failed step is being attached to the report.

What did you expect to happen?

I want to attach only each failed step screenshot to the report.

Serenity BDD version

4.x.x

JDK version

17

Execution environment

windows

How to reproduce the bug.

Github link: https://github.com/ak270296/Serenity-bdd

@wakaleo
Copy link
Member

wakaleo commented Oct 9, 2024

You would need to use soft assertions for that. A test will stop executing when it fails, and go through the following steps in dry-run mode.

@ak270296
Copy link
Author

ak270296 commented Oct 10, 2024

After adding soft assertion.

@Before
	public void setSoftAssertion(){
		Ensure.enableSoftAssertions();
	}
	
	@After
	public void reportSoftAssertion(){
		Ensure.reportSoftAssertions();
	}

But it doesn't work. I have added serenity.take.screenshots=FOR_FAILURES in serenity properties.

image

@ak270296
Copy link
Author

@wakaleo please help.

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

2 participants