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

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

import java.lang.annotation.*;

/**
 * IosGetElementContent annotation is used for getting text value from element and returning it. Return type of annotated
 * method has to be String.<br>
 * Value from html below is "Content text".
 * <pre>
 *     &lt;div&gt;Content text&lt;/div&gt;
 *    </pre>
 * <u>Example:</u>
 * <pre>
 *        {@literal @}IosGetElementContent (SOME_VALUE)
 *         String someElement();
 *    </pre>
 * HarnessException is thrown if element is NOT readable (see example below).
 * <pre>
 *      &lt;input title="title text [CIF001_S001_E013]" id="CIF001_S001_E013"&gt;
 *    </pre>
 * <p>
 * {@link #by()} could be used for other then default type of element search.
 * <u>Example2:</u><br>
 * <pre>
 *         {@literal @}IosGetElementContent{
 *               value = SOME_XPATH,
 *               by = MobileLookup.XPATH,
 *          )
 *          String someElement();
 *    </pre>
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface IosGetElementContent {
    /**
     * Value for identification of select element.
     */
    String value();

    /**
     * Type of element identification which will be used for element search. See {@link MobileLookup} for exact types.
     */
    MobileLookup by() default MobileLookup.DEFAULT;
}
