package cz.moneta.test.harness.support.web;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Executes custom action defined in default method. The annotated method must be <i>default</i>.<br>
 * This is applicable when is needed to do some other action which is not possible handle with predefined annotations.<br>
 * This annotation is NOT combinable with {@link Select}, {@link Click}, {@link TypeInto}. It is need to extend
 * class by StoreAccessor to use CustomAction.
 *
 * <u>Example:</u>
 * <pre>
 *    public interface SomePage extends SomeFlow, StoreAccessor {
 *        //...
 *        {@literal @}CustomAction
 *         default SomePage someCustomAction() {
 *              WebEndpoint endpoint = getEndpoint(SomeEndpointClass.class);
 *              endpoint.click(() -> SOME_ELEMENT_IN_PAGE);
 *              endpoint.waitForElementsToLoad(20, SOME_ELEMENT_IN_PAGE2);
 *              //...
 *              return null;
 *         }
 *         //...
 *    }
 * </pre>
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface CustomAction {
}
