org.jboss.arquillian.graphene.spi.findby.ImplementsLocationStrategy Maven / Gradle / Ivy
package org.jboss.arquillian.graphene.spi.findby;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.openqa.selenium.By;
import org.openqa.selenium.support.FindBy;
/**
* Enables to introduce new annotations of {@link FindBy} type with its own location strategy.
*
* E.g.: framework specific location strategies, extended grammars for well-known strategies, etc.
*
* Usage:
*
*
* @Retention(RetentionPolicy.RUNTIME)
* @Target(ElementType.FIELD)
* @ImplementsLocationStrategy(by = XYZLocationStrategy.class)
* public @interface FindByXYZ {
* String value();
* }
*
*
*
* public static class XYZLocationStrategy implements {@link LocationStrategy} {
* public {@link By} fromAnnotation({@link Annotation} annotation) {
* return ...;
* }
* }
*
*
* @author Lukas Fryc
*
* @see LocationStrategy
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface ImplementsLocationStrategy {
Class extends LocationStrategy> value();
}