Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run only failed test in IntelliJ IDEA

I'm running a bunch of Scala tests in IntelliJ. One is failing. I can't seem to be able to run just that one failing test (ala Visual Studio) - surely there must be a way to do this in the IDE?

like image 851
jimmy_terra Avatar asked Dec 08 '22 06:12

jimmy_terra


2 Answers

Rerun Failed Tests Button!

After first running press Rerun Failed Tests on toolbar enter image description here for execute all the tests that failed.

enter image description here

Also check this guide for more details.

like image 168
Anton Dozortsev Avatar answered Dec 11 '22 10:12

Anton Dozortsev


If you want to rerun a failed test, I would suggest to first filter the test results to show only failed tests. Then you right click your test(s) you want to rerun and select Run {testMethodName} or press Ctrl + Shift + F10.

An even more easy way is to click on the button right under the green rerun arrow (green arrow with red exclamation mark) to rerun all failed tests.

You can also run only one method by opening your test class, right click on your test method name, and also select Run {testMethodName}.

enter image description here

like image 44
Darek Kay Avatar answered Dec 11 '22 08:12

Darek Kay