Skip to content

Added api to get test status in after hooks#134

Merged
koodeex merged 2 commits into
ozontech:masterfrom
SergKhram:feature/added-test-result-in-after-hooks
Dec 12, 2025
Merged

Added api to get test status in after hooks#134
koodeex merged 2 commits into
ozontech:masterfrom
SergKhram:feature/added-test-result-in-after-hooks

Conversation

@SergKhram

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

@koodeex @siller174 check please

@SergKhram

Copy link
Copy Markdown
Contributor Author

@metafates check pls

@SergKhram

Copy link
Copy Markdown
Contributor Author

Who is currently working on this repository?

@siller174

Copy link
Copy Markdown
Collaborator

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

@sergei-khramkov-softswiss

Copy link
Copy Markdown

@metafates @koodeex ping

Comment thread pkg/framework/core/allure_manager/ctx/hooks_test.go Outdated
Comment thread pkg/framework/core/allure_manager/ctx/hooks.go Outdated
Comment thread pkg/framework/core/allure_manager/ctx/test_ctx_test.go Outdated
Comment thread pkg/framework/core/allure_manager/ctx/test_ctx_test.go Outdated
Comment thread pkg/framework/core/allure_manager/manager/execution_management_test.go Outdated
Comment thread pkg/framework/core/common/common.go
Comment thread pkg/framework/core/common/common_test.go
Comment thread pkg/framework/core/common/common.go Outdated
@metafates

metafates commented Dec 4, 2025

Copy link
Copy Markdown
Member

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

@SergKhram

Copy link
Copy Markdown
Contributor Author

@metafates check the fixes, pls

@SergKhram

Copy link
Copy Markdown
Contributor Author

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

Hello, ping

@selectme

Copy link
Copy Markdown

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

@koodeex koodeex merged commit 4667370 into ozontech:master Dec 12, 2025
3 checks passed
@metafates

Copy link
Copy Markdown
Member

Thank you!

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.

6 participants