Cucumber/Geb Binding Issue

304 views
Skip to first unread message

Brian Artman

unread,
Nov 4, 2015, 5:05:58 PM11/4/15
to Geb User Mailing List
Hello, 

I'm having issues getting my Cucumber test to work.  I've pulled down the example from the repo and that works.  So I must have something configured incorrectly in my project.  I've tried to match up my project to the configuration that's in the example. My env.groovy file matches the env.groovy file from the example.  Any guidance would be much appreciated.  I can provide further details of my setup as needed.  The example in the repo I'm referring to is here ... https://github.com/geb/geb-example-cucumber-jvm



groovy.lang.MissingMethodException: No signature of method: cucumber.runtime.groovy.GroovyWorld.to() is applicable for argument types: (java.lang.Class) values: [class com.mgl.ngr.automation.pages.LoginPage]
Possible solutions: is(java.lang.Object), any(), use([Ljava.lang.Object;), with(groovy.lang.Closure), any(groovy.lang.Closure), use(java.lang.Class, groovy.lang.Closure)
at cucumber.runtime.groovy.GroovyWorld.findWorldWithMethod(GroovyWorld.java:77)
at cucumber.runtime.groovy.GroovyWorld.invokeMethod(GroovyWorld.java:38)
at CucumberVUSStepDef$_run_closure1.doCall(CucumberVUSStepDef.groovy:6)
at ✽.Given a VUS that is "true"(C:/Development/GIT/ngr-automated-testing/src/cucumber/resources/features/CucumberVUS.feature:6)

Disconnected from the target VM, address: '127.0.0.1:51182', transport: 'socket'

Process finished with exit code 1



Thanks
Brian

Marcin Erdmann

unread,
Nov 7, 2015, 9:08:32 AM11/7/15
to geb-...@googlegroups.com
As the topic of your email suggests it looks like for some reason the binding is not updated.

Can you please:
- share your env.groovy file
- confirm that LoginPage extends Page
- confirm that env.groovy file is under src/cucumber/resources/env and your steps are under src/cucumber/resources/steps (I can see from the stacktrace that your feature is under src/cucumber/resources/features) 

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/ce76fc47-a59c-4913-baa2-727b8b57c8d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Artman

unread,
Nov 10, 2015, 3:55:34 PM11/10/15
to Geb User Mailing List
Thank you for your response.  Attached is my env.groovy file.  

My LoginPage is extending a class that we made, which in turn extends the Page class. I removed the middle class between those and still ran into the issue. 

env.groovy file is located here:  src\cucumber\resources\env\env.groovy

steps are located here: src\cucumber\resources\steps
env.groovy

Marcin Erdmann

unread,
Nov 12, 2015, 4:13:12 AM11/12/15
to geb-...@googlegroups.com
Sorry, I cannot spot anything obvious in your setup that would cause binding not to be enriched with Geb obejcts and methods.

Reply all
Reply to author
Forward
0 new messages