title: Running individual ScalaTest test methods in IntelliJ IDEA
body: <p>It is possible to run a single, selected JUnit test method in IntelliJ IDEA 12, however this does not seem to be possible with ScalaTest. You can run the whole test class or nothing, but there seems to be no finer grained control for ScalaTest (yet) in IntelliJ IDEA 12. (I haven't tried IDEA 13 yet.)</p>
  
  <p>So, the question:
  Is there a way to execute only a single, selected ScalaTest test method in IntelliJ (like it is possible with JUnit test methods.)</p>
  
  <p>Below is a code sample whose test methods I'd like to run individually in IntelliJ. Any idea how to do that? </p>
  
  <p>I've tried JUnitRunner but that did not help.</p>
  
  <pre><code>class NodeDAOTest extends FlatSpec with SessionAware with BeforeAndAfter {
  
    before{ IM3_SessionFactory.removeData
    println("before is running")}
    println("NodeDAOTest constructor.")
    def numberOfNodes=initAndCloseDB(transaction{NodeDAO.numberOfNodes})
  
  
    "Node" can "be added to DB and removed." in {
      val n =new TextNode
       assert(numberOfNodes===0)
  
      initAndCloseDB { transaction{session save n}}
       assert(numberOfNodes===1)
  
      initAndCloseDB { transaction{deleteNode(n)}}
       assert(numberOfNodes===0)
    }
  
    def getTag= initAndCloseDB {transaction{ session.createQuery("from Tag").list().get(0).asInstanceOf[Tag]}}
    def getNode=initAndCloseDB {transaction{ session.createQuery("from Node").list().get(0).asInstanceOf[Node]} }
  
    it can "be tagged and untagged" in {
      val t=new Tag
      val n=new TextNode
  
      assert(numberOfNodes==0,"before adding one tag (and Node), there should be 0 Node in the DB")
  
      initAndCloseDB{ transaction {addTag(t,n) }}
  
      assert (getNode.getNumberOfTags===1)
      assert (getTag.getNodes.size===1)
  
      initAndCloseDB(transaction{removeTag(t,n)})
  
      assert (numberOfNodes==1,"after removing the tag, there should be 1 Node in the DB")
      assert (getNode.getNumberOfTags===0)
      assert (getTag.getNodes.size===0)
    }
  
    "Tagged Node" can "be removed." in {
      val f=new TagAndNodeFixture
      assert(numberOfNodes==1)
      initAndCloseDB{ transaction {addTag(f.t,f.n) }}
      initAndCloseDB { transaction{deleteNode (f.n)} }
      assert(numberOfNodes==0)
      // the tag will be removed from the node
    }
  
    "Tag" can "be deleted and that will be removed from in-memory Nodes" in{
  
    }
  
  
  
  }
  </code></pre>