开发者

Generation of Selenium reports using Hudson (now known as Jenkins) from JUnit XML format file

开发者 https://www.devze.com 2023-03-14 14:52 出处:网络
For Test Automation of web project we use Hudson, PHPUnit, and Selenium. The results of the build are stored in the JUnit XML format.

For Test Automation of web project we use Hudson, PHPUnit, and Selenium. The results of the build are stored in the JUnit XML format.

When I try to include generation of reports using the Hudson Publish JUnit test result report option, the build finishes with Failed status.

Below is my Hudson configuration to run the tests.

sudo -u apache phpunit - log-junit /var/lib/hudson/jobs/Work-stars-Tests/builds/${BUILD_ID}/ seleniumReports/seleniumTests.xml + path to test php files

Generation of reports is enabled through the Hudson configuration option «Publish JUnit test result report», where I specify the path to the folder with PHP tests.

The user we use to run Hudson has permission to write/read files in the folder with the reports. As for the path we've tried to specify both full and relative.

The error No test re开发者_如何学JAVAport files were found. Configuration error? is displayed in the console after the build.

How do we resolve this issue?


Found my own solution to this problem :)

In Hudson project configuration settings modified execute shell command to

> #!/bin/sh -x phpunit --log-junit ${WORKSPACE}/zf/tests/_tmp/reports/seleniumTests.xml
> ${WORKSPACE}/zf/tests/selenium/; sed
> -i '/<testsuite name=".*\/"/D;/^  <\/testsuite>$/D'
> ${WORKSPACE}/zf/tests/_tmp/reports/seleniumTests.xml

and set following path to Junit reports

**/zf/tests/_tmp/reports/*.xml

Problem is solved. Yahoo!

0

精彩评论

暂无评论...
验证码 换一张
取 消