running Geb tests on a grails project from within IntelliJ with F10

I can launch most tests quite conveniently from within IntelliJ on my Grails project using control-shift-F10.  Now, however, we are trying to set up some functional tests using Geb and Spock and were having more troubles. The difficulty is this: when I go to run a Geb test, either by right clicking in the project menu or directly from the keyboard with alt shift F10, I seem to see different things at different times:

1) Sometimes I have an option of running the test as either a JUnit test or Grails
2) Sometimes it's only Grails
3) Sometimes the only option is JUnit

It's this last condition that the most troublesome, since the Geb tests really need to be run under grails, and not simply as JUnit tests. Is there any way to consistently get the Grails options OTHER than explicitly putting together a run configuration for each file I want to test ( because that's a bother )?  And why am I getting these different results at different times?  I've been trying to discern the pattern but so far it has escaped me.  As the pattern just been a little too subtle for me so far, or is the behavior really nondeterministic?

Thanks for any light you can throw on this problem. We really like IntelliJ as an IDE, and we really like Grails and Geb as a development/testing environment, but getting them all to play together peacefully hasn't quite worked out yet.
Ben

1 comment
Comment actions Permalink

I was bitten by something like this, and found that IntelliJ seems to remember the last choice (JUnit or Grails) for a given test/spec/method.  If you delete the configuration that IntelliJ automatically creates for it, then you get the choice again.

Also, IIRC, IntelliJ 10 didn't provide the Grails choice for integration or functional Spock specs, but IntelliJ 11 does.

0

Please sign in to leave a comment.