我正在使用放心的 lib 和范圍報告進行報告,ValidatableResponse reponseManualLead = given().header("Accept", "application/json")
.contentType("application/json").header("Authorization", access_token)
.body(requestBody).log().body().when()
.put(losdevUrl + "/endUrl").then().log().all();log().all() :控制臺日志中請求/響應的 Pritn 日志,我需要登錄 extentreport ,我們可以這樣做嗎?ExtentTestManager.getTest().log(LogStatus.INFO, "Response is:<br>" + "here");
1 回答

慕勒3428872
TA貢獻1848條經驗 獲得超6個贊
包含 JSON 請求/響應的推薦用法是通過MarkupHelper文檔中的方式:http: //extentreports.com/docs/versions/4/java/#markup-helpers-codeblock
Markup m = MarkupHelper.createCodeBlock(json, CodeLanguage.JSON);
test.pass(m);
// shorthand
test.pass(MarkupHelper.createCodeBlock(json, CodeLanguage.JSON));
代碼塊將被美化并顯示如下:
添加回答
舉報
0/150
提交
取消