/** * Constructs a scope out of the scope factory and the parent field, then searches for the injected field * in this scope. */ @Override public List<WebElement> findElements() { return scopeFactory.createLocator(scopeField).findElements().stream() .flatMap(element -> new DefaultElementLocator(element, searchField).findElements().stream()) .collect(toList()); }
/** * Return a DefaultElementLocator. */ @Override public ElementLocator createLocator(Field field) { return new DefaultElementLocator(resolveContext(field), field); }
@Override public WebElement findElement() { SearchContext context = getContext(); return new DefaultElementLocator(context, field).findElement(); }
@Override public List<WebElement> findElements() { return selector.findElements(searchContext).stream() .flatMap(webElement -> new DefaultElementLocator(webElement, field).findElements().stream()) .collect(toList()); }
/** * Creates a locator for the given field. */ @Override public ElementLocator createLocator(Field field) { return field.isAnnotationPresent(Global.class) ? new DefaultElementLocator(searchContext, field) : new SelectorScopedElementLocator(searchContext, selector, field); }
/** * Constructs a scope out of the scope factory and the parent field, then searches for the injected field * in this scope. */ @Override public WebElement findElement() { WebElement context = scopeFactory.createLocator(scopeField).findElement(); return new DefaultElementLocator(context, searchField).findElement(); }
@Override public ElementLocator createLocator(final Field field) { return field.isAnnotationPresent(Global.class) ? new DefaultElementLocator(webDriver, field) : new ScopedElementLocator(parentFactory, parentField, field); }
@Override public ElementLocator createLocator(Field field) { return new DefaultElementLocator(context, field); }