package cz.moneta.test.dsl.ufo.banka.pages.cards.debit;

import cz.moneta.test.dsl.ufo.banka.pages.main.client.settings.TIS051_S001_DispositionGeneratePage;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.banka.pages.cards.debit.PLK007_S002_DebitCardCancellationPage.PAGE_LABEL_XPATH;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(value = PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
public interface PLK007_S002_DebitCardCancellationPage extends WebFlow<PLK007_S002_DebitCardCancellationPage> {

    String PAGE_LABEL_XPATH = "//div[text()='PLK007_S002']";
    String CANCEL_BUTTON = "PLK007_S002_B003";
    String REASON_TO_CANCELLATION = "PLK007_S002_C002";
    String CARD_RETURNED_RADIO = "PLK007_S002_R001_1";

    @Select(value = REASON_TO_CANCELLATION, selectByOrder = true, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME))
    PLK007_S002_DebitCardCancellationPage selectReasonToCancel(int indexOfReasonToCancel);

    @Click(CARD_RETURNED_RADIO)
    PLK007_S002_DebitCardCancellationPage clickCardReturned();

    @Click(value = CANCEL_BUTTON, by = Lookup.XPATH)
    TIS051_S001_DispositionGeneratePage clickCancelPK();
}
