You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to rerun failed test scenario immediately after failure.
i have implemented Test Rule to rerun failed scenario but while running with maven command its unable to identify @rule
`public class RetryRule implements TestRule {
private int retryCount;
public RetryRule(int retryCount) {
this.retryCount = retryCount;
}
public Statement apply(Statement base, Description description) {
return statement(base, description);
}
private Statement statement(final Statement base, final Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
Throwable caughtThrowable = null;
// implement retry logic here
Log.info("retryCount: "+retryCount);
for (int i = 0; i < retryCount; i++) {
try {
base.evaluate();
return;
}
catch (Throwable t) {
caughtThrowable = t;
Log.info(description.getDisplayName() + ": run " + (i + 1) + " failed.");
}
}
Log.info(description.getDisplayName() + ": Giving up after " + retryCount + " failures.");
throw Objects.requireNonNull(caughtThrowable);
}
};
}`
i am using serenity 3.4.2 and Junit 4.13.2
The text was updated successfully, but these errors were encountered:
I am trying to rerun failed test scenario immediately after failure.
i have implemented Test Rule to rerun failed scenario but while running with maven command its unable to identify @rule
`public class RetryRule implements TestRule {
private int retryCount;
public RetryRule(int retryCount) {
this.retryCount = retryCount;
i am using serenity 3.4.2 and Junit 4.13.2
The text was updated successfully, but these errors were encountered: