Rerun in cucumber junit5

64 views Asked by At

`I was able to do rerun of the failed test cases using cucumber with junit or testng but I am not able to do the same in cucumber with junit5

I am able to store the failed test cases in a txt file but I am not able to use the same txt file in the ReRunner class.Please help in achieving the rerun.Thanks in advance for help

Language :Java

Code:- import org.junit.platform.suite.api.ConfigurationParameter;

import org.junit.platform.suite.api.IncludeEngines;

import org.junit.platform.suite.api.SelectClasspathResource;

import org.junit.platform.suite.api.Suite;

import static io.cucumber.junit.platform.engine.Constants.*;

    @Suite

    @IncludeEngines("cucumber")

    @SelectClasspathResource("features")

    @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "com.bdd.test")

    @ConfigurationParameter(key = FEATURES_PROPERTY_NAME, value = "target/rerun.txt")

    @ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty,html:target/cucumber.html")

    public class ReRunner {}

Exception: /Feb 06, 2024 3:56:22 PM io. cucumber. junit.platform. engine.DiscoverySelectorResolver warnWhenCucumberFeaturesPropertyIsUsed WARNING: Discovering tests using the cucumber. features property. Other discovery selectors are ignored! Please request/upvote/sponsor/ect better support for JUnit 5 discovery selectors. See: https://github.com/cucumber/cucumber-jvm/pu11/2498 org. junit.platform.suite.engine.NoTestsDiscoveredException: Suite[com.bdd.test.runners.app.ReRunner] did not discover any tests ‹2 internal lines> at java.base/java.til.Iterator.forEachRemaining (Iterator.java:133) <7 internal lines>/

Rerun.txt data: classpath:features/app/LoginTest.feature.97

0

There are 0 answers