Test Framework Customize Results Tree View Content

Answered

I have a test runner that does not use the standard JUnit run config. I have been able to customize the gutter icons with the runLineMarkerContributor to good success. The issue I'm running into is when the test results run, when the test node in the tree is right clicked, the options that show up are not my gutter actions but standard JUnit actions. 

Is this customizable? I don't quite see how to do this. 

0
7 comments

Hi,

Please try implementing com.intellij.execution.actions.RunConfigurationProducer.

0

Thank you Karol Lewandowski

I am able to have my action show up using the RunConfigurationProducer. However the JUnit tests still show up first and cause mine to go into the overflow. 

In the gutter icon, I'm able to suppress the unwanted JUnit configs with the method 
RunLineMarkerContributor.Info#shouldReplace . I would like to have consistent appearance between the gutter options and the test results tree options. 

 

0

Hi,

Please try implementing com.intellij.execution.actions.RunConfigurationProducer#shouldReplace.

0

Thank you! Karol Lewandowski  one last thing:

When coming from the test result tree the psiElementRef: Ref<PsiElement> is of type KtUltraLightMethodForSourceDeclaration. How do I work with this as it is an inner class and not visible. 

0

Sorry, but I don't understand the problem. Where do you get this value and what do you want to get from it?

0

Karol Lewandowski  I am getting it in this method parameter: https://github.com/JetBrains/intellij-community/blob/master/platform/lang-api/src/com/intellij/execution/actions/RunConfigurationProducer.java#L129

 

I would like to get the method name from this parameter so I can create my test config for that method. 

0

KtUltraLightMethodForSourceDeclaration implements PsiMethod. I suggest checking if an element is a PsiMethod, casting it if so, and using getName.

0

Please sign in to leave a comment.