import org.scalatestplus.play._
import org.openqa.selenium.WebDriver

class UserControllerBrowserSpec extends PlaySpec 
    with OneServerPerSuite with OneBrowserPerSuite 
      with HtmlUnitFactory {
  "Users page" must {
    "should show emtpy users" in {
      go to s"http://localhost:$port/"
      pageTitle mustBe "Manage Users"

      textField("email").value = "a@b.com"
      submit()
      
      eventually { pageTitle mustBe "Manage Users" }
      find(xpath(".//*[@class='table']/tbody/tr[1]/td[4]")) map {
        _.text mustBe ("a@b.com") 
      }
    }
  }
}