allure-go icon indicating copy to clipboard operation
allure-go copied to clipboard

Added api to get test status in after hooks

Open SergKhram opened this issue 1 month ago • 8 comments

Access to Test Result in AfterEach Hook

What was implemented?

Introduced the ability to access the current test result inside the AfterEach hook using the method GetCurrentTestResult(). This method provides the status and details of the just-finished test, allowing users to react to test outcomes directly in the hook.

How was it implemented?

The test result is stored and made available to the AfterEach hook context after each test execution. The API exposes GetCurrentTestResult() for use in custom suite hooks, without changing the core test or hook execution logic.

Why was it added?

This feature allows users to perform custom actions (logging, attachments, cleanup) based on the result of each test. It improves flexibility for reporting and debugging, making it easier to handle failed, broken, or skipped tests right after they finish.

SergKhram avatar Nov 27 '25 12:11 SergKhram

@koodeex @siller174 check please

SergKhram avatar Nov 27 '25 13:11 SergKhram

@metafates check pls

SergKhram avatar Nov 28 '25 06:11 SergKhram

Who is currently working on this repository?

SergKhram avatar Dec 02 '25 10:12 SergKhram

Hey @SergKhram I'm not working on it, I think @koodeex or @metafates shall check it, but also not sure

siller174 avatar Dec 02 '25 11:12 siller174

@metafates @koodeex ping

Hello! Thank you for your work. Left some review comments

metafates avatar Dec 04 '25 07:12 metafates

@metafates check the fixes, pls

SergKhram avatar Dec 06 '25 08:12 SergKhram

Hello! Thank you for your work. Left some review comments

Hello, ping

SergKhram avatar Dec 10 '25 16:12 SergKhram

hi, @metafates please, check the review's fixes :)

selectme avatar Dec 12 '25 11:12 selectme

Thank you!

metafates avatar Dec 12 '25 14:12 metafates