You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to utilize AfterTest to prepare Attachments for the report. For example, i want to include container logs so that i can understand what failed. This only makes sense once the test is finished and it should be done in any case, so AfterTest is conceptionally the ideal place for it. My understanding of AfterTest is based on other test frameworks like junit, where it is always executed, especially to free resources allocated in a BeforeTest.
However, it seems to me that AfterTest is not executed if a FailNow or BreakNow was called. I tried putting AfterTest in the end of the method, in the beginning and deferred. Only with the defer call it executed, but then the same test appeared twice in the report (i assume this is because the test is already reported, but after test is executed afterwards and reports again with a slightly longer runtime):
So is there a right way to call AfterTest to achieve the common behaviour, or is this just not possible right now?
My apologies for the delay.
You are correct, at the moment test terminates after allure.FailNow or allure.BreakNow is called.
Using deferred statement would be the recommended approach , we'll work on fixing the report to not create duplicate test records.
Again, my apologies for taking forever to resolve this. I created a PR with a fix for the issue and will merge it shortly. Please let me know if that will resolve your issue.
Hello again :)
I'd like to utilize AfterTest to prepare Attachments for the report. For example, i want to include container logs so that i can understand what failed. This only makes sense once the test is finished and it should be done in any case, so AfterTest is conceptionally the ideal place for it. My understanding of AfterTest is based on other test frameworks like junit, where it is always executed, especially to free resources allocated in a BeforeTest.
However, it seems to me that AfterTest is not executed if a FailNow or BreakNow was called. I tried putting AfterTest in the end of the method, in the beginning and deferred. Only with the defer call it executed, but then the same test appeared twice in the report (i assume this is because the test is already reported, but after test is executed afterwards and reports again with a slightly longer runtime):
![Bildschirmfoto von 2020-03-19 09-19-52](https://user-images.githubusercontent.com/10500766/77046285-f7315a00-69c2-11ea-8161-88803cbdd8ac.png)
So is there a right way to call AfterTest to achieve the common behaviour, or is this just not possible right now?
Code to reproduce:
The text was updated successfully, but these errors were encountered: