I have some problems regarding functional testing in Grails using GEB+Spock. If i run "test-app" it always fails, but if i run "test-app -integration" before "test-app" it works!
The following test-sequence illustrates my problem:
Run #1
grails> clean
grails> test-app -functional
...
Tests PASSED
Run #2
grails> clean
grails> test-app
...
Tests FAILED
Run #3
grails> clean
grails> test-app -functional
...
Test PASSED
grails> test-app
...
Test PASSED
The tests that are failing are throwing "geb.waiting.WaitTimeoutException: condition did not pass in 10.0 seconds". It is worth noting that the test cases that are failing are waiting for results from a database query.
So my question is what exactly is the difference then the functional tests are run through "test-app -integration" versus "test-app"?
The only difference from what i thought was that "test-app" is running all test phases (unit, integration, functional).
And the weird thing is that it do works somehow, but only if i run "test-app -integration" first :/
Im using the following setup:
- grails 2.0.1
- geb 0.7.0
- spock 0.6
- htmlunit-driver 2.0rc3 (ive tried with 2.20.0 but gave me even more problems)
Really hoping that someone can help me on this. Geb+spock seems like a nice solution, when it works...
Regards Tobbe