0
我使用播放2.2和Specs2并具有下列测试游戏框架:在运行播放测试
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner
import play.api.test.Helpers.running
import play.api.test.{FakeApplication, TestBrowser, TestServer}
import java.util.concurrent.TimeUnit
import org.openqa.selenium.firefox.FirefoxDriver
import org.fluentlenium.core.domain.{FluentList, FluentWebElement}
import org.openqa.selenium.NoSuchElementException
"Application" should {
"work from within a browser" in {
running(TestServer(port, application = FakeApplication(additionalConfiguration = Map("configParam.value" -> 2)), classOf[FirefoxDriver]) {
.....
}
}
}
configParam.value
正在访问下列方式中的应用
import scala.concurrent.Future
import play.api.libs.json._
import play.api.Play._
import play.api.libs.ws.Response
import play.api.libs.json.JsObject
object Configuration {
val configParamValue = current.configuration.getString("configParam.value").get
}
时IntegrationSpec忽略配置提供给FakeApplication
当运行play test
时,使用的configParam.value
是application.conf
中的一个,而不是在FakeApplication
中通过的那个。
我在这里做错了什么?
更多细节将是不错的。您正在使用的Play和Specs2的版本等。另外还有您在此处使用的类的Imports。 –
我已添加版本和导入语句 – Prasanna