九、TestNG超时测试

“超时”表示如果单元测试花费的时间超过指定的毫秒数,那么TestNG将会中止它并将其标记为失败。

使用属性 timeOut = 参数(1s*1000)

 

package com.lc.testngChaoShi;

import org.testng.annotations.Test;

public class testNG13 {
  
    @Test(timeOut = 5000)  //5000 表示  5秒
    public void testNG13_01() throws InterruptedException {
        Thread.sleep(6000);
    }
}

 

posted @ 2020-12-14 21:27  中华田园猫饭饭  阅读(135)  评论(0编辑  收藏  举报