lundi 20 avril 2015

ScalaTest Plus not recognizing tests

I've been tasked to update and write a series of tests on an app in Scala Play, a language and framework I'm unfamiliar with. Part of what I'd like to do is integrate the ScalaTestPlus library. To get started I have been following the following tutorial:

http://ift.tt/1Iy9Spj

Unfortunately I am not getting very far. I have added a new unit test file to the tests folder:

import org.scalatestplus.play._

class StackSpec extends PlaySpec {

  "A Test" must {
    "pass" in {
      assert(1 == 1)
    }
    "Fail" in {
      assert(1 != 1)
    }
  }
}

and I have updated my build.sbt to include the scalatestplus library

  "org.scalatestplus" % "play_2.37" % "1.2.0" % "test"//,

Using Activator, I am trying to run my test file with test-only. Everything compiles without errors, but activator is not finding any tests

[info] No tests were executed.

I don't believe the issue is with activator, since I can run old test files (from the previous engineer) using the test and test-only commands. A quick sample of one of the previous (working) test files:

import java.util.concurrent.TimeUnit
import com.sun.xml.internal.bind.v2.TODO
import scala.collection.JavaConverters._
import controllers.Application
import models.{Item, PriorityBucket}
import play.api.test._

class WebSpec extends PlaySpecification {

  "Home page" should {
    "do something" in new WithSeleniumDbData(TestUtil.testApp) {
      Redacted.deleteAll()

      val ObId = TestUtil.create(Some(PriorityBucket.Low),
          Some(Application.ENGLISH))
      val item = Item.find(ItemId).get

      browser.goTo("/")
      browser.await().atMost(2, 
          TimeUnit.SECONDS).until(Selectors.all_obs).isPresent
    }

Any ideas where I've gone astray? Thanks in advance for the help!

I am using scala 2.11 I am using play 2.3.7

Aucun commentaire:

Enregistrer un commentaire