2014-07-22 23 views

回答

0

是的,在TestNG測試中,您基本上可以獲取ITestResult對象並遍歷它並使用JSON發佈請求將所有結果存儲在CouchDB中。

這是僞代碼,但實際的解決辦法是相似的:

@AfterSuite 
public void storeResults(ITestResult resultContainer) { 
    List<ITestResult> results = resultContainer.getSuite().getTestResults(); 
    for (ITestResult res : results) { 
     storeInCouchDB(testName, testDatetime, res.getResult().isPassed()); 
    } 
}