當我以maven Test身份運行時,未在目標/ surefire報告中創建測試輸出文件夾。 當我將我的套件作爲maven測試運行時,surefire報告會更新,但不會創建測試輸出文件夾。但是當我作爲Testng Suite運行時,會創建測試輸出文件夾。當我以maven身份運行時,目標/ surefire報告中未創建測試輸出文件夾測試
我該怎麼做才能在Run-> Maven測試中創建測試輸出文件夾?
當我以maven Test身份運行時,未在目標/ surefire報告中創建測試輸出文件夾。 當我將我的套件作爲maven測試運行時,surefire報告會更新,但不會創建測試輸出文件夾。但是當我作爲Testng Suite運行時,會創建測試輸出文件夾。當我以maven身份運行時,目標/ surefire報告中未創建測試輸出文件夾測試
我該怎麼做才能在Run-> Maven測試中創建測試輸出文件夾?
當你作爲TestNG的套件運行你會使用TestNG的默認報告位置,這是
${your base dir}/test-output
當您從Maven的運行,你基本上使用Maven的萬無一失插件執行TestNG的測試。默認情況下,報告輸出目錄爲surefire爲
${your build directory}/surefire-reports
這就是爲什麼您會在兩次運行中看到差異。 爲了得到在同一文件夾中的輸出TestNG的那樣,你可以明確地指定萬無一失插件報告目錄下的配置部分
<reportsDirectory>${basedir}/test-output</reportsDirectory>
,然後根據運行Maven的測試,看輸出那裏。
你可以參考下面的鏈接來看看如何配置你的pom的surefire插件。 http://maven.apache.org/plugins/maven-surefire-plugin/examples/testng.html
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
這對我有用:) – 2014-09-09 21:22:24
不,我還沒有能夠得到TestNG的報告和Maven同時報告時,我作爲運行運行 - > Maven的測試 – SeleniumTester 2012-02-28 06:05:28
我覺得你的問題是「我應該怎麼做才能讓測試輸出文件夾中創建運行 - > Maven測試?「 :)所以這就是答案。 你可以粘貼你的surefire插件配置。我懷疑你保留usedefaultlisteners屬性爲false。 – 2012-02-28 07:20:41
在我的配置文件中包含 true testFailureIgnore>之後,現在我能夠查看TestNG Reports以及Surefire Reports。但是現在,如果我想編輯Suite文件夾的名稱,我該怎麼辦? –
SeleniumTester
2012-02-28 08:45:45