开发者

Can I run grails integration & functional tests against a running server?

开发者 https://www.devze.com 2023-01-19 04:24 出处:网络
I\'m finding the feedback look pretty slow when running integration and functional tests in Grails. Is there a way I can run them against a running server instance while I\'m 开发者_运维知识库writing

I'm finding the feedback look pretty slow when running integration and functional tests in Grails. Is there a way I can run them against a running server instance while I'm 开发者_运维知识库writing the tests, to save on server startup time each time they're executed?


You can use grails interactive which does what you want without starting a server. It starts a JVM and keeps it running and you can use it to run unit and integration tests. Keep in mind that you'll eventually run out of memory and need to restart periodically. See http://docs.grails.org/latest/guide/gettingStarted.html#usingInteractiveMode

Also in 1.3.5 you can run functional tests against a running server. Use the baseUrl attribute described in section 9.3 at http://grails.org/doc/latest/


there's an option --baseUrl

e.g.

grails test-app --baseUrl=http://localhost:8080/myapp/

that runs tests against a running instance, one draw back is that the slate isn't wiped clean after a test, so if your test writes to the db, uploads a file, or some other permanent change to the application, then you may have to do some tearDown.

This is briefly documented at the end of the function testing section of the grails docs

http://grails.org/doc/latest/guide/testing.html#functionalTesting

It's useful for writing/debugging functional tests


I'm using Grails 1.3.5 and the EasyB plugin for stories in the context of functional tests.

Take a look at http://padcom13.blogspot.com/2010/10/grails-easyb-and-selenium.html for step-by-step instructions.

0

精彩评论

暂无评论...
验证码 换一张
取 消