Max
Max

Reputation: 1335

Selecting a Gradle task to run the test each run

I have this menu when I first run the test(method) enter image description here

But if I run this test again from the current menu (second or more time), it will run the latest task I ran. So I need help with how to configure IntelliJ Idea in a way that IDEA always asked me which task should be run. Is it possible to configure it in that way?

Upvotes: 1

Views: 430

Answers (2)

Andrey
Andrey

Reputation: 16391

Add the suggest.all.run.configurations.from.context=true into Help | 'Edit Custom Properties' file and restart IDE.

Upvotes: 2

archit.panigrahi
archit.panigrahi

Reputation: 11

For Intellij IDEA to ask you the task each time a temporary configuration is run, you can do the following.

  1. Open Run Configuration dropdown on your top right side of the IDE. (The navigation bar where most probably the name of last task you ran would be showing).

  2. Go to "Edit Configurations..." option. Run/Debug Configurations window should popup.

  3. In the left side tab of the popup window, select "Templates" option.

  4. In the bottom part of the popup window, you should see an option to fill the Temporary configurations limit. It should have a default value.

  5. Change it to 0.

  6. Click on Apply. OK.

And done!!!.

Now unless you go ahead and create Permanent Configurations for your project on your own, Temporary Configurations won't be getting stored.

Hence each time you click on the play button on your test class, it should ask you the task which you want to run (like the one you have shown in the picture).

Good luck using Intellij IDEA.

Upvotes: 0

Related Questions