空手道测试框架中的重试机制如何在空手道测试框架(如Junit和TestNG)中重试失败测试。 就像是 公共类重试实现IRetryAnalyzer {
private int count = 0;
private static int maxTry = 3;
@Override
public boolean retry(ITestResult iTestResult) {
if (!iTestResult.isSuccess()) { //Check if test not succeed
if (count < maxTry) { //Check if maxtry count is reached
count++; //Increase the maxTry count by 1
iTestResult.setStatus(ITestResult.FAILURE); //Mark test as failed
return true; //Tells TestNG to re-run the test
} else {
iTestResult.setStatus(ITestResult.FAILURE); //If maxCount reached,test marked as failed
}
} else {
iTestResult.setStatus(ITestResult.SUCCESS); //If test passes, TestNG marks it as passed
}
return false;
}
}
答案 0 :(得分:1)
它在版本 0.9.5.RC 5上对我有效。但是,也许这是前面提到的“解决方法”之一?
您要做的就是这样,默认尝试3次:
const divInput = document.getElementById('divInput');
const textarea = document.getElementById('inputTypePreview');
divInput.addEventListener('input', (event) => {
const t = event.inputType;
textarea.innerHTML = `${t} \n`;
if (t === 'insertParagraph' || t === 'insertLineBreak')
textarea.innerHTML = 'Enter detected \n';
});
答案 1 :(得分:0)
截至目前,这是一项开放式功能请求:https://github.com/intuit/karate/issues/247
但是有很多工作要做。如果查看轮询示例,您可能会得到一些想法:https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/polling/polling.feature