天天看點

Jenkins+Nunit+Testlink 自動化測試平台

最近在搭建Jenkins+Nunit+Testlink 測試平台,遇到一些問題,記錄如下:

問題1,Nunit測試結果不能填入testlink。

原因:在Nunit .xml檔案中的測試結果不能被Jenkins識别。但是Junit .xml檔案中的測試結果可以被填充到Testlink。

解決方案:修改Jenkins Nunit plugin的代碼,主要是為了保留Junit .xml的測試報告。

改動後的功能: 建立一個“junitReports”檔案夾,并把Junit .xml測試結果儲存在這個檔案夾下。

Problem1, the Nunit test result cannot be filled into testlink.

           Reason: test results in the Nunit .xml file cannot be recognized by Jenkins.But the test result in Junit .xml can be filled into Testlink.

           Solution: Modified the code of Jenkins Nunit plugin, keep the test report .xmlof Junit.

           Release: Nunit.hpi attached, the folder “junitReports“ will be created in thejob workspace, and the Junit .xml is stored under the folder.

Problem2, Cannot execute two or more test suites in one Jenkins job, if all testresult will be filled into testlink.

Solution:

1.     Add test cases under any test suite into a test plan (for example) in Testlink.

2.     write the execuation command of testsuites in the area “Single Build Steps“

3.     “Publish Nunit Test Report“, theNunit plugin will be called, and the Junit .xml will be generated

4.     leave the area “Iterative Test Build Steps“ to be empty.

5.     “Test Result Seeking Strategies“,key function, get test results from Junit .xml, and fill these test resultsinto testlink.

6.     Please check a demo below