Getting Started with Playframework 2.0 and Selenium Getting Started with Playframework 2.0 and Selenium selenium selenium

Getting Started with Playframework 2.0 and Selenium


Here is an example on how to do it with HTMLUnit, if that helps you.

Inspired from: https://github.com/joscha/Play20/blob/master/samples/scala/computer-database/test/IntegrationSpec.scala

import org.specs2.mutable._import play.api.test._import play.api.test.Helpers._import org.fluentlenium.core.filter.FilterConstructor._class IntegrationSpec extends Specification {  "Application" should {    "work from within a browser" in {      running(TestServer(3333), HTMLUNIT) { browser =>        browser.goTo("http://www.myRockstartDomain.com:3333/")          browser.$("header h1").first.getText must contain("Play 2.0 sample application — Computer database")          browser.$("#pagination li.current").first.getText must equalTo("Displaying 1 to 10 of 574")          browser.$("#pagination li.next a").click()          browser.$("#pagination li.current").first.getText must equalTo("Displaying 11 to 20 of 574")          browser.$("#searchbox").text("Apple")          browser.$("#searchsubmit").click()      }    }  }}