i'm trying test web application, play framework 2.5, playspec , fluentlenium here code testing login page:
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 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") } } } }
i have compile error displaying :
identifier expected 'with' found. browser.fill("input").with("mylogin","mypassword")
i want may have seen before in scala code because keyword. in case, think surrounding word in backticks
`with`
solved issue. not sure if helps or not.