原创

由于应用程序批处理作业导致测试用例的验证延迟

温馨提示:
本文最后更新于 2024年04月12日,已超过 37 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我

我有一个测试,我必须等待 5 分钟才能更改验证状态。但是,在自动化执行中等待那么长时间是不正确的。我在想有一种方法可以让这个测试第一个测试用例运行直到该测试步骤,然后让同一类的所有其他测试示例运行,然后返回到该测试示例并验证状态更改。

我不确定这是否是一个正确的解决方案,如果是,我不明白我应该如何实施它。

编辑:添加一段代码以便更好地传达我对这一要求的看法。

@BeforeMethod(alwaysRun = true)
public void setup(){
//pre-requisite steps//
}

@Test( groups = "DelayedValidation"){
//steps to make that change
//This is where the application takes about 5 mins to change the status//
Assert.assertEquals(getStatusText(),"Done","Status is not changed")

}

@AfterMethod((alwaysRun = true)
public void cleanUp(){
//logout steps//
}

我的逻辑:

@Test(groups ="DelayedValidation"){
//steps to make that change

// some logic to halt this test case and run other testcases in this class

}

@AfterMethod
public void runValidation(onlyForGroups = "DelayedValidation"){
//checks the status change after 5 mins or when all testcases are completed.
}
正文到此结束
热门推荐
本文目录