Junit5 launcher won't find my Cucumber tests

66 Views Asked by At

I'm trying to use the Cucumber Junit Platform engine for running my cucumber tests, but none are run.

They're all placed inside resources/features.

I have a RunCucumberTest.java class:

@Suite
@IncludeEngines("cucumber")
@SelectClasspathResource("features")
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty")
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "com.integrationtest.steps")
@IntegrationTest
public class RunCucumberTest {
}

The code I use for running the tests is:

final LauncherDiscoveryRequest request = request().selectors(selectDirectory("features"))
                .build();
final Launcher launcher = LauncherFactory.create();
final TestPlan testPlan = launcher.discover(request);
        logFoundTests(testPlan);

        final SummaryGeneratingListener summaryListener = new SummaryGeneratingListener();
        launcher.registerTestExecutionListeners(summaryListener);
        launcher.execute(request);

        summaryListener.getSummary().printTo(new PrintWriter(System.out));

This is what gets printed to the console:

Test run finished after 56 ms
[         1 containers found      ]
[         0 containers skipped    ]
[         1 containers started    ]
[         0 containers aborted    ]
[         1 containers successful ]
[         0 containers failed     ]
[         0 tests found           ]
[         0 tests skipped         ]
[         0 tests started         ]
[         0 tests aborted         ]
[         0 tests successful      ]
[         0 tests failed          ]

My tests can be successfully run inside Intellij, both from the feature files themselves or by running the RunCucumberTest.java file. What am I missing here?

0

There are 0 best solutions below