2016-06-07 44 views
0

我试图测试Web应用程序,游戏框架2.5,与PlaySpec和FluentLenium 下面是测试登录页面代码:测试与PlaySpec和FluentLenium

import play.api.test._ 
import play.api.test.Helpers._ 

import org.scalatestplus.play.PlaySpec 

import org.scalatestplus.play._ 

class IntegrationSpec extends PlaySpec { 

    "My Application" should { 
     "work within a browser" in { 
      running(TestServer(3333), HTMLUNIT) { browser => 
       browser.goTo("http://localhost:3333") 
       browser.title mustBe "My Application" 

       browser.$("label").first.getText() must equal ("Login") 
       browser.$("label", 1).getText() must equal ("Password") 
       browser.fill("input").with("myLogin","myPassword") 
       //submit("#submit") 
      } 
     } 
    } 
} 

我有一个编译错误显示:

identifier expected but 'with' found. 

    browser.fill("input").with("myLogin","myPassword") 

回答

0

我想说我可能以前在某些Scala代码中看到过,因为它是关键字。在这种情况下,我认为围绕这​​个词在反引号如

`with` 

解决了这个问题。不知道这是否有助于你。