Search code examples
tomcatgrailsseleniumgrails-pluginembedded-jetty

Run grails run-app programmatically


I'm using Selenium for a grails application, but in order to run that I have to run grails run-app for selenium to work. How can I start grails run-app or embedded tomcat inside IDE from JUnit so that Selenium can start the server itself and test it automatically.

Or if it helps I can change to jetty. But how can I achieve the automated testing? Thanks a lot.


Solution

  • The functional test phase in Grails takes care of this.

    You need to install the Selenium plugin for Grails and put the functional tests in the test/functional directory. When running 'grails test-app' Grails will make sure that your application is running before it triggers Selenium to start testing.