Right-click on a test class does not show the "run" options

Running IDEA 12.1.1 on a new MacBook Pro to which I migrated using my Time Machine backup.
Everything works properly, except that right-clicking a test class does not display the Run options (Run as JUnit / Specs2 / ScataTest etc).
I tried invalidating caches and re-importing the project from the POM files, to no avail. I am able to run the tests by manually creating a run configuration.

I saw this SO thread but I'm reluctant to completely obliterate my IDEA installation unless no other options is available.

Has anyone experienced this or has an idea what I can do to resolve the issue?

Thanks

17 comments
Comment actions Permalink

The same "problem" after updating to the last version of IntelliJ -> 2019.1. In our case it has been fixed by updating the plugins for Cucumber and Gherkin.  If you have similar problem - check if the plugins are up to date. Regards.

4
Comment actions Permalink

Your project works just fine at my environment - ContextMenuTest is successfully run via context menu action.

Please try to execute 'main menu | file | invalidate caches' and check if it helps.

Also provide your idea.log (main menu | help | show log), it might contain relevant error messages.

Denis

1
Comment actions Permalink

Same thing happened to me after upgrade to 2019.2. It was caused by a plugin not working properly on new Intellij version. I had to find this question first to figure out what's wrong, since problems seemed to be totally not related.  It's worth to be more careful with installed plugins.

1
Comment actions Permalink

Hi, just a guess, but could you make sure the source root is mark as a test source root?   (Go to the project window, find this class, then find the source root directory.  Then right click, choose "Mark Directory As" menu item, and then click "Test Source Root".)

(With my settings, the test classes now have a pale light green background and I can right-click on a test class and see the Run/Debug menu items for it.)

Matt

0
Comment actions Permalink

Yes, of course it is. I also tried unmarking and remarking, no go. This is definitely something to do with the move to the new computer and the way Apple implements migration usin Time Machine restore.

0
Comment actions Permalink

Hi Shai,

Could you provide a sample project which shows the problem at your environment?

Denis

0
Comment actions Permalink

Attached.
Right clicking the test class in this project on my computer doesn't display the Run option in the context menu. However, I sent this project to a colleague, and it does display the option on his machine. Meaning, it's something with my local copy of IDEA or its settings.



Attachment(s):
test-context-menu-issue.zip
0
Comment actions Permalink

As I already wrote in my original post, I tried invalidating caches.
Log file attached.



Attachment(s):
idea.log.gz
0
Comment actions Permalink

The log shows the problem:

2013-04-23 11:37:33,108 [147451904]  ERROR - penapi.actionSystem.impl.Utils - update failed for AnAction with ID=RunClass
java.lang.NoSuchMethodError: com.intellij.ide.browsers.WebBrowserService.getUrlToOpen(Lcom/intellij/psi/PsiElement;)Ljava/lang/String;
    at com.intellij.javascript.debugger.execution.JavaScriptDebugConfigurationProducer.createConfigurationByLocation(JavaScriptDebugConfigurationProducer.java:85)



I.e. there was an error during preparing 'run' action for the context menu. Checking further

Denis
0
Comment actions Permalink

Apparently re-installing IDEA did solve the issue, as opposed to the experience of the guy form the SO post. Not that it explains what caused the issue originally, but at least my problem is solved :)

Thanks

0
Comment actions Permalink

It looks like your IJ binaries were somehow broken because I've just checked that IU 12.1.1 has that method at the binary distribution (namely, $IJ_HOME/lib/openapi.jar).

Denis

0
Comment actions Permalink

Lina 6656, thank you very much for your comment - it saved my day. I upgraded to intellij idea 2019.1 and was not able to run unit tests at all (my colleague had the same problem with another project also). So we just disabled these plugins because we don't need them and issue was fixed.

0
Comment actions Permalink

I had this issue too after upgrading to 2019.2.

The following plugins had suspicious entries in my log, after disabling them it worked:

SVN Toolbox, Markdown Navigator, Docker.

0
Comment actions Permalink

For me , it was disabling the AWS toolkit plugin. 

0
Comment actions Permalink

After upgrading to 2019.1 Ultimate i have "No ClassDefFoundError: com/intellij/execution/application/ApplicationConfigurationOptions", the issue described here https://youtrack.jetbrains.com/issue/IDEA-216816 . It is sad that the issue blocks you from the way you used to work in IDEA (

So since switching off Cucumber for Java (i even did not check, if it works) is not a solution for my project, there's always a way you can manually create configuration and run tests :) 

0
Comment actions Permalink

I'm not 100% sure if it was due to the update (2019.2), but I found the JUnit plugin disabled. Worth checking.

0

Please sign in to leave a comment.