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;

/**
 * Annotation is used for accept alert window on the web. Parameter waitSecondsForAlert is <u>mandatory</u>. If alert text does not contains
 * defined expectedAlertText <u><i>AssertException</i></u> is thrown.<br>
 * <u>Example:</u>
 * <pre>
 *         {@literal @}AcceptAlert (waitSecondsForAlert = SOME_TIMEOUT)
 *          SomePage acceptAlert();
 *    </pre>
 *
 * <u>Example2:</u><br>
 * <pre>
 *         {@literal @}AcceptAlert (
 *               waitSecondsForAlert = SOME_TIMEOUT,
 *               expectedAlertText = SOME_TEXT,
 *          )
 *          SomePage checkAlertTextandAcceptAlert();
 *    </pre>
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface AcceptAlert {

    /**
     * Maximum waiting time (timeout) for Alert window
     */

    int waitSecondsForAlert();

    /**
     * Text for comparison with text in the alert window
     */

    String expectedAlertText() default "";
}