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

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

import java.lang.annotation.*;

/**
 * Annotation is used for check element content. String parameter is <u>mandatory</u>. If Element does not contains
 * defined content <u><i>AssertException</i></u> is thrown.<br>
 * <u>Example:</u>
 * <pre>
 *         {@literal @}AndroidCheckElementContent (SOME_VALUE)
 *          SomePage checkSomeElementContent(String content);
 *    </pre>
 * {@link #by()} can be used for use XPATH, ID or DEFAULT to identify element.<br>
 * <u>Example2:</u><br>
 * <pre>
 *         {@literal @}AndroidCheckElementContent (
 *               value = SOME_XPATH,
 *               by = MobileLookup.XPATH,
 *          )
 *          SomePage checkSomeElementContent(String content);
 *    </pre>
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(AndroidCheckElementContents.class)
public @interface AndroidCheckElementContent {
    /**
     * Value for element identification.
     */
    String value();

    /**
     * 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;
}
