Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test runner class not found in selected project in Cucumber #450

Open
ratelz opened this issue Jan 26, 2022 · 1 comment
Open

Test runner class not found in selected project in Cucumber #450

ratelz opened this issue Jan 26, 2022 · 1 comment

Comments

@ratelz
Copy link

ratelz commented Jan 26, 2022

Issue:
Test class not found in selected project

Steps to recreate:

Create a cucumber feature file.
Create a Step Definitions file
Create a Runner test file using Junit
But when I run the Runner file , it shows all tests are passed but when I click on any of the test it shows the error "Test class not found in selected project".

Screenshot 2022-01-26 162724

Screenshot 2022-01-26 162914

Screenshot 2022-01-26 162945

Screenshot 2022-01-26 164251

@ratelz ratelz changed the title Test runner class not found in selected project Test runner class not found in selected project in Cucumber Jan 26, 2022
@mpkorstanje
Copy link
Contributor

mpkorstanje commented Jan 26, 2022

You're using cucumber-junit which integrates Cucumber with JUnit 4. This means that you are using the JUnit Plugin for Eclipse, not the Cucumber plugin.

While JUnit 4 no longer requires tests to be classes most tools still assume this is the case because JUnit 4 does not provide a way for Cucumber to specify if the test file is a class or something else. So I would consider it unlikely that this bug will be fixed by the Eclipse team.

With JUnit 5, JUnit does provide a way for Cucumber to communicate that the test files are files and where they are located. Though the JUnit Eclipse Plugin is equally unable to handle this. Still I would consider it possible that this bug will be fixed by the Eclipse team. So consider switching to JUnit 5 with the cucumber-junit-platform-engine and file a bug report with the Eclipse Team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants