Tuesday, June 21, 2011

Grails - Functional Testing

Grails - Functional Testing

In addition to unit testing, Grails supports functional testing of your web application.

For this purpose, it uses the free open-source Canoo WebTest.

If you want to try out webtest very quickly, you can create a new project with create-app, create a domain class and then "generate-all" this domain class. Then generate the test layout with "create webtest" and generate the webtest itself with "generate-webtest". You can then run the tests with "run-webtest". Note that the scaffolded webtest will not work out of the box if you use dynamic scaffolding of your controller. Just use generative scaffolding for the controller instead.

No comments:

Post a Comment