Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run all Specs2 tests under IntelliJ IDEA?

In my Scala project, my Specs2 tests are structured as follows:

src/test/scala
-> my.package
---> my.package.sub1
------> SomeTest1
------> SomeTest2
---> my.package.sub2
------> SomeTest3

I'm using SBT to build all of this, and I can use sbt test to run all tests in my package.

I'd like to use IntelliJ IDEA's built-in Specs2 run configuration support. I point it to use all tests in my.package.

Running this yields the error message Error running <run config name>: Not found suite class. It cannot find Specs2 test suites. IDEA runs my tests if I point it to a subpackage.

How do I configure IDEA to look in all packages and run all the test suites it finds?

like image 863
DCKing Avatar asked Apr 17 '14 16:04

DCKing


People also ask

How do I run a specific junit test in IntelliJ?

Open the class where the tests are located and check the part where inteliJ shows the the number of lines, at the beginning of each test method there is a green icon (looks like a play button) just hit that icon and the specific test method will be executed.

How do I run kotlin tests in IntelliJ?

Place the caret somewhere inside the curly braces in the class, press Alt+Insert . Select Test Function from the menu. This will create a test function from the default template. Name the test, press Enter , and the cursor will end up in the function body.


1 Answers

I've managed to run all my Specs2 tests in IDEA 13.1.4 and the more recent 14.0.1 using All in package for Test kind and In whole project or In single module for Search for tests. I left Test Package field empty.

enter image description here

I had to create this configuration manually.

You may want to use Ctrl+Shift+F10 to create a Specs2 configuration and then modify it accordingly.

like image 190
Andna Avatar answered Sep 21 '22 11:09

Andna