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;

/**
 * Select a frame using {@link #value()}<br>
 * <u>Example:</u>
 *    <pre>
 *         {@literal @}SwitchToFrame (SOME_VALUE)
 *          SomePage switchToSomeFrame();
 *    </pre>
 * {@link #by()} could be used for other then default type of element search.
 * <u>Example2:</u><br>
 *    <pre>
 *         {@literal @}SwitchToFrame {
 *               value = SOME_XPATH,
 *               by = Lookup.XPATH,
 *          )
 *          SomePage switchToSomeFrame();
 *    </pre>
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface SwitchToFrame {

    /**
     * frameElement – The frame element to switch to.
     */
    String value();

    /**
     * Type of element identification which will be used for element search. XPATH, ID or DEFAULT can be used.
     * @see Lookup
     */
    Lookup by() default Lookup.DEFAULT;
}
