Double click to navigate to test class/method when running Test Suites

已回答

Hi,

When running JUnit tests in IntelliJ, there is an option to "jump to source" by double-clicking on test method name in "Run" (or "Debug") window tool.

As results, IntelliJ navigates to test method line inside test class.

But there isn't such option when running tests as suite (a.k.a @RunWith(JUnitPlatform.class)).

Double click on test method doesn't navigate to test method inside test class and right clicking on test method name just gives "Nothing here" option.

I'm using suites to run multiple tests (hundreds) with only-once resources initialization. It would be nice to be able to open specific test method in it's test class just by double clicking on it. Right now, I have to search tests by literally typing it names because I can't even copy the test class/ method name from "Run" window.

2

Hello,

Could you please provide sample  project demonstrating the issue? It seems to work fine on my machine.

0
Avatar
Permanently deleted user

Hi,

When you build a suite test, validate that your test methods annotated with @Test from JUnit Jupiter engine (org.junit.jupiter.api.Test).

Sorry for not specifying this in original post.

Having both or only Vintage engine behaves as expected.

If you still need the sample project, I can submit it

0
Avatar
Permanently deleted user

I opened issue https://youtrack.jetbrains.com/issue/IDEA-192507 with sample project that can be used to reproduce this issue as well.

 

0

Thanks for clarification! It's a known issue with junit5. Please see related requests on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-184403, https://youtrack.jetbrains.com/issue/IDEA-183491

0

请先登录再写评论。