protected Navigator findUsingByIfPossible()

in module/geb-core/src/main/groovy/geb/navigator/SearchContextBasedBasicLocator.groovy [139:151]


    protected Navigator findUsingByIfPossible(
            Map<String, Object> attributes,
            String selector,
            @ClosureParams(value = FromString, options = "Boolean,org.openqa.selenium.By,Map<String, Object>") Closure<Navigator> navigatorFromBy
    ) {
        if (attributes.size() == 1 && selector == MATCH_ALL_SELECTOR) {
            BY_SELECTING_ATTRIBUTES.findResult { String attributeName, Closure<By> byFactory ->
                if (hasStringValueForKey(attributes, attributeName)) {
                    navigatorFromBy.call(false, byFactory.call(attributes[attributeName]), [:])
                }
            }
        }
    }