詹金斯总是表现出成功 - TestNG,Selenium

时间:2017-03-29 09:48:23

标签: java selenium jenkins testng jenkins-plugins

我是詹金斯的新手,我的构建问题。我正在用Selenium,Java和TestNG编写UI测试。 我的问题是,即使某些测试失败,Jenkins也会显示Finished: SUCCESS

    ===============================================
    TestAll
    Total tests run: 10, Failures: 1, Skips: 0
    ===============================================

    [SSH] exit-status: 0
    TestNG Reports Processing: START
    Looking for TestNG results report in workspace using pattern: **/testng-results.xml
    Did not find any matching files.
    Started calculate disk usage of build
    Finished Calculation of disk usage of build in 0 seconds
    Started calculate disk usage of workspace
    Finished Calculation of disk usage of workspace in 0 seconds
    Notifying upstream projects of job completion
    No emails were triggered.
    Finished: SUCCESS

如何解决我的问题?

1 个答案:

答案 0 :(得分:2)

我假设您正在构建一个Maven项目。 要停止构建测试失败,请转到项目的配置部分,然后转到构建部分和"目标&选项线"添加:

-Dmaven.test.failure.ignore=false

如果发现错误,应该停止构建。