3

I want to write webdriver tests against my Play application. Normally when I do this in Java, I use Jetty to pull up a web server from within the test and run my webdriver tests against that server. I've been trying to look in the endless amounts of Python code which is the Play framework scripts, but I haven't found anything so far.

How can I bootstrap a Play server from within a test?

EDIT: I do not wish to use the selenium integration in Play.

karianneberg
  • 329
  • 4
  • 17

2 Answers2

2

Play provides a test mode, which launches your app and let's you run your unit as well as integration tests (based on selenium).

http://www.playframework.org/documentation/1.2.4/guide10 is a good starting point for reading.

There is also a plugin for webdriver suport:

http://www.playframework.org/modules/webdrive-0.2/home

Georg Engel
  • 917
  • 9
  • 16
0

If you want to see how the play jvm is actually started (without the python-stuff), you can start it with 'play run', then use "Process Explorer" to inspect the process and look at the arguments. They can look something like this:

"C:\Program Files\Java\jdk1.6.0_27\bin\java" -javaagent:c:\playPath/play-1.2.4.jar -XX:-UseSplitVerifier -Dfile.encoding=utf-8 -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Dplay.debug=yes -classpath C:\p\app\conf;c:\playPath\play-1.2.4.jar;[ALL JARS YOU NEED] -Dapplication.path=C:\p\app -Dplay.id= play.server.Server ""

Maybe this info helps you to start it manually in your test.

mbknor
  • 168
  • 6