You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class MyModule
extends Module
{
static content = {
myBase { $() } // this seems to work
}
Navigator theBase() {
return $() // this fails
}
}
In Geb 0.9.2, all this worked fine. After trying to update to 0.10.0, the reference to $() from a module function (like theBase()) yields an exception instead:
{noformat}
org.codehaus.groovy.runtime.metaclass.MethodSelectionException: Could not find which method $() to invoke from this list:
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.lang.String)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.lang.String, groovy.lang.Range)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.lang.String, int)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map, groovy.lang.Range)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map, int)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map, java.lang.String)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map, java.lang.String, groovy.lang.Range)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map, java.lang.String, int)
{noformat}
Geb 0.9.3 seems equally broken in this regard, though the exact error is slightly different for that version:
{noformat}
groovy.lang.MissingMethodException: No signature of method: geb.navigator.NonEmptyNavigator.$() is applicable for argument types: () values: []
Possible solutions: eq(int), is(java.lang.String), is(java.lang.Object), tag(), max(), min()
at geb.navigator.NonEmptyNavigator.methodMissing(NonEmptyNavigator.groovy:483)
at geb.content.PageContentSupport.methodMissing(PageContentSupport.groovy:53)
at geb.Module.methodMissing(Module.groovy:65)
{noformat}
One can workaround this by using find() instead but AFAIU, $() should be equivalent.
Oddly (for me at least), $() seems still to work when used in content definitions.
The text was updated successfully, but these errors were encountered:
Since 0.9.3 [Module implements Navigator|http://jira.codehaus.org/browse/GEB-181] and thus there is no need for the $() method on Module anymore. The "backing" Navigator instance is the base navigator for the module. You can simply call Navigator methods on Module now without having to obtain the base navigator beforehand.
Fair enough, but please note that we are still pre-1.0 for the exact reason that we still have a lot of breaking changes in the API (see section 4 of Semantic Versioning Specification). The goal is to get to 1.0 ASAP because Geb will be 5 years old this year but we're not there yet.
Originally created by Benjamin Bentmann.
Consider this example snippet:
In Geb 0.9.2, all this worked fine. After trying to update to 0.10.0, the reference to
$()
from a module function (liketheBase()
) yields an exception instead:{noformat}
org.codehaus.groovy.runtime.metaclass.MethodSelectionException: Could not find which method $() to invoke from this list:
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.lang.String)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.lang.String, groovy.lang.Range)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.lang.String, int)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map, groovy.lang.Range)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map, int)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map, java.lang.String)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map, java.lang.String, groovy.lang.Range)
public abstract geb.navigator.Navigator geb.navigator.Navigator#$(java.util.Map, java.lang.String, int)
{noformat}
Geb 0.9.3 seems equally broken in this regard, though the exact error is slightly different for that version:
{noformat}
groovy.lang.MissingMethodException: No signature of method: geb.navigator.NonEmptyNavigator.$() is applicable for argument types: () values: []
Possible solutions: eq(int), is(java.lang.String), is(java.lang.Object), tag(), max(), min()
at geb.navigator.NonEmptyNavigator.methodMissing(NonEmptyNavigator.groovy:483)
at geb.content.PageContentSupport.methodMissing(PageContentSupport.groovy:53)
at geb.Module.methodMissing(Module.groovy:65)
{noformat}
One can workaround this by using
find()
instead but AFAIU,$()
should be equivalent.Oddly (for me at least),
$()
seems still to work when used in content definitions.The text was updated successfully, but these errors were encountered: