How to show Rest Assured logs in Surefire or TestNG report

443 views
Skip to first unread message

Tausif Shaikh

unread,
May 9, 2018, 4:21:58 AM5/9/18
to REST assured
 
Hi,

I want to show up rest assured logs (Request & Response both) in my reports (Surefire/ TestNG) for all the failed test cases.

I am able to print the logs (both request & response) in console whenever failure occurs using below Rest Assured inbuilt method:


given().config(RestAssured.config().logConfig(logConfig().enableLoggingOfRequestAndResponseIfValidationFails())).

But not able to integrate with my reports, Reports only shows the partial logs like below


createTestAction(com.restapitest.actions.TestAction)  Time elapsed: 1.102 s  <<< FAILURE!
java
.lang.AssertionError:
1 expectation failed.
Expected status code <201> but was <500>.

    at com
.restapitest.actions.createTestAction.(TestAction.java:45)


Can someone help me to achieve this?


---
Thanks,
Tausif







gaozi...@gmail.com

unread,
Aug 7, 2018, 5:27:24 AM8/7/18
to REST assured
You can integration with Allure report framework(RestAssured+TestNG+Allure) which have support Attachment annotation to print the response in the finally Allure report.

在 2018年5月9日星期三 UTC+8下午4:21:58,Tausif Shaikh写道:
Reply all
Reply to author
Forward
0 new messages