package cz.moneta.test.harness.support.mobile.ios;

import cz.moneta.test.harness.support.mobile.MobileLookup;

import java.lang.annotation.*;

/**
 * IosClick annotation is used for click on element.<br>
 * Dynamic path functionality is supported. See {@link cz.moneta.test.harness.support.web.DynamicPathPart}
 * for use or open  @see <a href="https://confluence.moneta.cz/display/CONT/Dynamic+Elements">Confluence Best Practises page</a><br>
 * <u>Example:</u>
 *    <pre>
 *         {@literal @}IosClick (SOME_VALUE)
 *          SomePage simpleClick();
 *    </pre>
 * {@link #andWait()} Used for wait to element after click.<br>
 * <u>Example2:</u>
 *    <pre>
 *         {@literal @}IosClick{
 *               value = SOME_VALUE,
 *               andWait = {@literal @}IosWait(value = XPATH, by = MobileLookup.XPATH),
 *          )
 *          SomePage someClickWithWaitAndJSClick();
 *    </pre>
 * {@link #by()} could be used for other then default type of element search.
 * <u>Example3:</u><br>
 *    <pre>
 *         {@literal @}IosClick{
 *               value = SOME_XPATH,
 *               by = MobileLookup.XPATH,
 *          )
 *          SomePage clickToSomeElementByXpath();
 *    </pre>
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(IosClicks.class)
public @interface IosClick {
    /**
     * Value for element identification.
     */
    String value() default "";

    /**
     * Wait for element after click. See {@literal @}{@link IosWait} annotation.
     */
    IosWait andWait() default @IosWait;

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

    /**
     * If set true will be used input String parameter of method to substitute %s in xpath.
     */
    boolean isStringDynamicXpath() default false;
}
