Skip to content

fix(selenide): deduplicate attachments on nested step failures - #1505

Open
chiragbitoni wants to merge 1 commit into
allure-framework:mainfrom
chiragbitoni:fix/selenide-deduplicate-attachments
Open

chiragbitoni wants to merge 1 commit into
allure-framework:mainfrom
chiragbitoni:fix/selenide-deduplicate-attachments

Conversation

@chiragbitoni

Copy link
Copy Markdown

Fixes #1453

Problem

When Selenide executes nested steps (for instance, a custom high-level test step wrapping an element action or assertion), failure in an inner step triggers �fterEvent with EventStatus.FAIL for both the inner step and all enclosing steps during step commit. Previously, this caused duplicate screenshot and page source attachments to be added across every enclosing step for the exact same failure.

Solution

  • Track captured Throwable instances in AllureSelenide using a WeakHashMap-backed set.
  • In �fterEvent, check the failure throwable and its cause hierarchy (getCause()) against previously recorded failures before capturing screenshots and page source attachments.
  • Enclosing steps encountering the same failure instance or wrapped cause do not create duplicate attachments.
  • Distinct failures across steps continue to capture attachments normally.
  • Unit tests added covering nested step deduplication, wrapped cause deduplication, and distinct failure attachment retention.

…e-framework#1453)

When Selenide logs nested steps, failure in an inner step triggers afterEvent
with FAIL for both the inner step and enclosing steps. Previously, this caused
duplicate screenshots and page source attachments across all nesting levels.

Track captured failure throwables using a WeakHashMap-backed set and verify
the exception and its cause chain before capturing attachments, preventing
duplicate attachments for the same failure while preserving attachments for
distinct errors.
@CLAassistant

CLAassistant commented Nov 7, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

AllureSelenide attaches Screenshot and Page source once per nesting level of SelenideLogger.step

2 participants