我怎样才能开始玩!测试中的框架服务器
我想针对我的 Play 应用程序编写 webdriver 测试。通常,当我在 Java 中执行此操作时,我会使用 Jetty 从测试中拉出一个 Web 服务器,并针对该服务器运行我的 Webdriver 测试。我一直在尝试查看无数的 Python 代码(即 Play 框架脚本),但到目前为止我还没有找到任何东西。
如何在测试中引导 Play 服务器?
编辑:我不想在 Play 中使用 selenium 集成。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Play 提供了一种测试模式,可以启动您的应用程序并让您运行您的单元以及集成测试(基于 selenium)。
http://www.playframework.org/documentation/1.2.4/guide10是一个很好的阅读起点。
还有一个支持 webdriver 的插件:
http://www.playframework.org/modules/ webdrive-0.2/home
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
如果您想查看 play jvm 是如何实际启动的(没有 python-stuff),您可以使用“play run”启动它,然后使用“Process Explorer”检查进程并查看参数。它们看起来像这样:
"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,地址=8000,服务器=y,挂起=n -Dplay.debug=yes -classpath C:\p\app\conf;c:\playPath\play-1.2.4.jar;[您需要的所有 JARS] -Dapplication.path=C:\p\app -Dplay.id= play.server。服务器“”
也许此信息可以帮助您在测试中手动启动它。
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.