Closed cressie176 closed 12 years ago
Not 100% sure but I guess it is the CucumberConfig.groovy
file. If you use test/cucumber
and test/functional
you have to configure this in the config file because the plugin uses test/functional
as default now. I have updated the cucumber grails geb article.
Another possibility is a missing import in a step file. If you see GroovyBackend.parse
in the callstack, cucumber has a problem parsing a groovy script file (hooks or steps). Spent already a few hours myself looking for this erro a couple of times....
I hope this helps..
I'm getting the exact same issue. And Martin has been kindly trying to help me on the geb mailing list: http://markmail.org/message/ycduw5arw54k5ydz
So far unsolved.
This is what's in my CucumberConfig.groovy file:
cucumber { tags = ["~@wip"]
features = ["test/cucumber"]
glue = [
"test/cucumber",
"test/functional"
]
}
Hi,
two things:
could you please try to remove the "test/functional" from glue. That does not work with the plugin since 0.5.0. It will be automatically on the classpath so we can still call the geb stuff from the steps but we don't want cucumber to look in "test/functional" for step or hook code.
Adding "test/functional" to the Books_geb example breaks the example with MethodMissing. It is not exactly the same message but I think it should help...
if not, it would be great if you could simply email me the source of your grails project (if there is nothing secret about it) so that I can take a look at it.
I have already gained some practice tracking down such issues building the plugin. ;-) It is probably just some little detail that needs to be documented.
Or may be we are looking at the wrong place and it is an environment problem:
I'm testing (using the Books_geb example) with grails 2.0.3/4, geb 0.7.0 and grails-cucumber-0.5.0.
What is your environment?
OMG that made all the difference! Thank you Martin.
I removed the "test/features" section from CucumberConfig & changed it to "glue = features" as yours is, and now my tests are running. (Not passing yet, got other issues now! But at least they're running.
I did actually have the CucumberConfig file like that initially, but I also had the file structure with everything mixed together. Possibly the combination of correct file structure & correct glue config was required.
Thank you so much for your help, Martin!
Hi Martin,
Sorry for the lack of response. This is a pet project and I got side tracked onto real work for a few days. I got it working now too. I'd referenced an older version of the Geb plugin, and also not separated out the steps into a separate cucumber directory.
Now that's working I've hit another snag. It doesn't seem possible to use the grails-remote-control plugin with the cucumber plugin to setup remote test data, e.g.
remote { Book.build() }
The reason is that the remote plugin requires the remote closure to be compiled into a class file, but grails isn't creating class files for the code under test/cucumber. I can workaround by putting the closures below the test/functional source folder, but it's going to be a bit nasty. Any thoughts?
Thanks,
Steve
On 2 June 2012 16:25, Martin Hauner < reply@reply.github.com
wrote:
Not 100% sure but I guess it is the
CucumberConfig.groovy
file. If you usetest/cucumber
andtest/functional
you have to configure this in the config file because the plugin usestest/functional
as default now. I have updated the cucumber grails geb article.Another possibility is a missing import in a step file. If you see
GroovyBackend.parse
in the callstack, cucumber has a problem parsing a groovy script file (hooks or steps). Spent already a few hours myself looking for this erro a couple of times....
Reply to this email directly or view it on GitHub: https://github.com/hauner/grails-cucumber/issues/15#issuecomment-6078322
Hi Steve,
moved the compiled step def issue to #17, closing this one. :)
I'm getting exactly this same error, tried to follow these instructions and still get it.
I'm using the grails-cucumber plugin in my "jinkies" project. Might be a useful point of reference. Source code here - https://github.com/acuminous/jinkies
Hi superchris,
did you try the suggestions mentioned in the older comments? If so, can you provide a stripped down grails project that I could look at?
I'm still working on #17 by the way (.. trying to understand my code I wrote a few month back ;-) too catch compile errors before running the cucumber features.
FYI - I got this issue in IntelliJ when trying to run an individual test (Shift + F10) because it seems to explicitly name the test in the command executed:
--conf C:\<mypath>\grails-2.2.0/conf/groovy-starter.conf "test-app unit: com.myproj.PkgBuildService.testOneWarning -echoOut"
where testOneWarning
is the name of a test. If I change the name of that test, the same code still gets run (for some reason), resulting in this Null Pointer exception when, presumably, the system can't find this test.
The workaround, for me, was to re-configure the context (Shift + Ctrl + F10) and select Grails which somehow brings it to recognize that there are new function names.
I'm getting the problem described in https://github.com/hauner/grails-cucumber/issues/6
I've started with a completely blank project. Followed the instructions at https://github.com/hauner/grails-cucumber/wiki/Testing-Grails-with-Cucumber-and-Geb to the point where firefox is launching and the test is failing. Then I went through and updated geb and selenium to the latest versions - everything still worked. Finally I updated cucumber from 0.2.3 to 0.5.0 at which point I get the NullPointer...
| Error Error executing script TestApp: java.lang.NullPointerException: Cannot invoke method propertyMissing() on null object (Use --stacktrace to see the full trace)
BuildConfig.groovy
GebConfig.groovy
No CucumberConfig.groovy
StackTrace