Skip to content

Make TestNG custom listener evidence work automatically#1312

Merged
baev merged 1 commit into
mainfrom
testng-listener-order
Jul 8, 2026
Merged

Make TestNG custom listener evidence work automatically#1312
baev merged 1 commit into
mainfrom
testng-listener-order

Conversation

@baev

@baev baev commented Jul 8, 2026

Copy link
Copy Markdown
Member

Context

Starting with TestNG 7.5, TestNG changed listener callback ordering in a way that could close the Allure test result before custom ITestListener callbacks added their evidence. This PR makes Allure handle that ordering automatically, so users on TestNG 7.5+ can keep custom listeners registered with @Listeners or testng.xml and still get steps and attachments on the correct test case.

Example: a custom ITestListener.onTestFailure(...) callback that calls Allure.addAttachment("Screenshot on failure", "image/png", screenshotStream, ".png") now attaches that screenshot to the failed test automatically.

Related closed reports: #707, #875, #444, #813, #390, #352, #215, #177.

fixes #1150

Checklist

@baev baev added pr:new feature Change that add something new for end users pr:improvement Change that improves some user experience but can't be considered as a new feature and removed theme:testng pr:new feature Change that add something new for end users labels Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Allure Report Summary

Name Duration Stats New Flaky Retry Report
Allure Java – Pull request #1312 26m 37s Passed tests 1884   Skipped tests 2 10 0 0 View
Allure Java GitHub actions run (2026-07-08T08:51:28.226Z) 26m 37s Passed tests 1884   Skipped tests 2 10 0 0 View

@baev
baev merged commit 4c6be6d into main Jul 8, 2026
12 of 13 checks passed
@baev
baev deleted the testng-listener-order branch July 8, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Change that improves some user experience but can't be considered as a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞: ITestListener of TestNG caused the Allure does not display test's steps at all, but custom ones only.

2 participants