zebrunner / carina

Carina automation framework (TestNG): Web, Mobile, API, DB etc testing...
https://zebrunner.github.io/carina
Apache License 2.0
954 stars 217 forks source link

Add ability to collect logs from custom testNG listeners. #860

Closed kolyakrasnik closed 4 years ago

kolyakrasnik commented 4 years ago

In case we use custom listener with public void onTestFailure(ITestResult result) we lose the logs from this method. The cause is that our CarinaListerer logic had been executed before and we closed threadLogAppenders. Naming our custom listener with name < CarinaListerer didn't solve the ordering issue.

kolyakrasnik commented 4 years ago

Checked flow with adding custom listener to : pom level, suite level, test class level (via annotation). The same result - CarinaListener has highest priority.

vdelendik commented 4 years ago

@kolyakrasnik, let's test in 6.3.34. there is a possibility to register LinkedListeners with exact order: https://github.com/qaprosoft/carina/blob/c8e5fdce7ec5bdb46249c02b7ddd37e391125138/carina-core/src/main/java/com/qaprosoft/carina/core/foundation/AbstractTest.java#L49

vdelendik commented 4 years ago

declaring listeners via LinkedListener annotation organize order in invocation. So all carina logs will be registered in zafira correctly